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.
This commit is contained in:
Oliver Brakmann
2014-09-18 18:06:30 +02:00
parent 6c399e50a8
commit 97ce246a27

View File

@@ -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<INotifyObjectivesUpdated>();