fix a bug with secondary objectives

This commit is contained in:
Florian Stinglmayr 2022-01-29 10:48:49 +01:00
parent dd9b558b3c
commit e7a1656d2a

View File

@ -146,25 +146,23 @@ namespace EliteBGS.BGS {
"\" was generated, please report this.");
}
if (completed.Influences.Count > 1) {
foreach (var other in completed.Influences) {
string faction = other.Key;
if (string.IsNullOrEmpty(faction)) {
continue;
}
foreach (var influences in other.Value) {
ulong system_address = influences.Key;
if (!faction.Equals(results[0].Faction) ||
(faction.Equals(results[0].Faction) && system_address != current_system_address)) {
string system = systems.TryGetValue(system_address, out string sys) ? sys : "";
results.Add(new InfluenceSupport() {
Faction = faction,
Influence = influences.Value,
System = system,
SystemAddress = system_address,
RelevantMission = results[0] as MissionCompleted
});
}
foreach (var other in completed.Influences) {
string faction = other.Key;
if (string.IsNullOrEmpty(faction)) {
continue;
}
foreach (var influences in other.Value) {
ulong system_address = influences.Key;
if (!faction.Equals(results[0].Faction) ||
(faction.Equals(results[0].Faction) && system_address != current_system_address)) {
string system = systems.TryGetValue(system_address, out string sys) ? sys : "";
results.Add(new InfluenceSupport() {
Faction = faction,
Influence = influences.Value,
System = system,
SystemAddress = system_address,
RelevantMission = results[0] as MissionCompleted
});
}
}
}