fix bug about failed missions

This commit is contained in:
Florian Stinglmayr 2022-01-06 16:15:13 +01:00
parent 6d404a99e2
commit 69fddcaed6

View File

@ -109,9 +109,9 @@ namespace EliteBGS.BGS {
acceptedMissions[accepted.MissionID] = accepted;
} else if (e.Is(Events.MissionFailed)) {
var failed = e as MissionFailedEntry;
var accepted = acceptedMissions[failed.MissionID];
if (accepted == null) {
OnLog?.Invoke("Mission failed that wasn't accepted, please adjust time frame.");
MissionAcceptedEntry accepted = null;
if (!acceptedMissions.TryGetValue(failed.MissionID, out accepted)) {
OnLog?.Invoke("Mission failed that wasn't accepted in the given time frame, please adjust start date.");
continue;
}
entry = new MissionFailed(accepted) { Failed = failed, System = current_system };