further mission improvements thanks to CMDR Shakaka

This commit is contained in:
2022-02-24 22:40:00 +01:00
parent cc7fe5cd10
commit 28c65bcf72
4 changed files with 69 additions and 2 deletions

View File

@@ -208,8 +208,28 @@ namespace EliteBGS.BGS {
foreach (var other in completed.Influences) {
string faction = other.Key;
if (string.IsNullOrEmpty(faction)) {
OnLog?.Invoke(string.Format(
"Mission \"{0}\" has empty faction name in influence block, "+
"so this influence support was ignored. " +
"Please check the README on why this happens.", completed.HumanReadableName)
);
continue;
}
/* Now comes the fun part. Sometimes the influence list is empty for a faction.
* This happens if the faction in question
*/
if (other.Value.Count() == 0) {
OnLog?.Invoke(string.Format(
"Mission \"{0}\" gave no influence to \"{1}\", so we assume this is because the " +
"faction is in a conflict and cannot gain influence right now. " +
"If this assessment is wrong, just remove the entry from the objective list.",
completed.HumanReadableName, faction
));
// Add empty entry
other.Value.Add(current_system_address, "");
}
foreach (var influences in other.Value) {
ulong system_address = influences.Key;
ulong accepted_address = 0;