fix a minor bug with failed missions

This commit is contained in:
Florian Stinglmayr 2022-01-27 23:23:15 +01:00
parent afad459210
commit 3df438a465
3 changed files with 10 additions and 4 deletions

View File

@ -115,12 +115,14 @@ namespace EliteBGS.BGS {
foreach (MissionFailed failed in missions) { foreach (MissionFailed failed in missions) {
MissionFailedEntry f = failed.Failed; MissionFailedEntry f = failed.Failed;
builder.AppendFormat("Failed {0} mission(s) \"{1}\" targeting {2}\n", builder.AppendFormat("Failed {0} mission(s) \"{1}\" targeting {2}\n",
failed.Entries.Count, failed.Amount,
f.HumanReadableName == null ? f.Name : f.HumanReadableName, f.HumanReadableName == null ? f.Name : f.HumanReadableName,
failed.Faction failed.Faction
); );
} }
builder.Append("\n");
return builder.ToString(); return builder.ToString();
} }

View File

@ -29,6 +29,9 @@ namespace EliteBGS.BGS {
return -1; return -1;
} }
// +1 since the other entries are just copies of the one we have in our properties
public int Amount => Entries.Count + 1;
public override string ToString() { public override string ToString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@ -37,8 +40,7 @@ namespace EliteBGS.BGS {
} }
builder.AppendFormat("{0}x Mission failed: \"{1}\"", builder.AppendFormat("{0}x Mission failed: \"{1}\"",
// +1 since the other entries are just copies of the one we have in our properties Amount,
Entries.Count + 1,
Failed.HumanReadableName != null ? Failed.HumanReadableName : Failed.Name Failed.HumanReadableName != null ? Failed.HumanReadableName : Failed.Name
); );

View File

@ -244,12 +244,14 @@ namespace EliteBGS.BGS {
foreach (MissionFailed failed in missions) { foreach (MissionFailed failed in missions) {
MissionFailedEntry f = failed.Failed; MissionFailedEntry f = failed.Failed;
builder.AppendFormat("Failed {0} mission(s) \"{1}\" targeting {2}\n", builder.AppendFormat("Failed {0} mission(s) \"{1}\" targeting {2}\n",
failed.Entries.Count, failed.Amount,
f.HumanReadableName == null ? f.Name : f.HumanReadableName, f.HumanReadableName == null ? f.Name : f.HumanReadableName,
failed.Faction failed.Faction
); );
} }
builder.Append("\n");
return builder.ToString(); return builder.ToString();
} }