From 97ce246a27dcf15a287290dd683fd0b860784e3c Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Thu, 18 Sep 2014 18:06:30 +0200 Subject: [PATCH] Prevent already failed objectives from being marked as completed The same change was not and must not be done in the reverse case. It should be and is possible to mark an already completed objective as failed. Consider a case where a player is supposed to capture, but not destroy, a building. He captures it, the objective is complete. However, later in the game that building gets destroyed. In this case, the objective should be changed to failed. --- OpenRA.Mods.RA/Player/MissionObjectives.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Player/MissionObjectives.cs b/OpenRA.Mods.RA/Player/MissionObjectives.cs index bdaf011718..73433077e8 100644 --- a/OpenRA.Mods.RA/Player/MissionObjectives.cs +++ b/OpenRA.Mods.RA/Player/MissionObjectives.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.RA public void MarkFailed(Player player, int objectiveID) { - if (objectiveID >= objectives.Count || objectives[objectiveID].State == ObjectiveState.Failed) + if (objectiveID >= objectives.Count || objectives[objectiveID].State != ObjectiveState.Incomplete) return; var inous = player.PlayerActor.TraitsImplementing();