Fix winstate logic for cooperative games
This commit is contained in:
@@ -214,8 +214,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Info.EarlyGameOver)
|
if (Info.EarlyGameOver)
|
||||||
|
{
|
||||||
foreach (var p in enemies)
|
foreach (var p in enemies)
|
||||||
p.PlayerActor.Trait<MissionObjectives>().ForceDefeat(p);
|
{
|
||||||
|
p.WinState = WinState.Won;
|
||||||
|
p.World.OnPlayerWinStateChanged(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -224,12 +229,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
player.World.OnPlayerWinStateChanged(player);
|
player.World.OnPlayerWinStateChanged(player);
|
||||||
|
|
||||||
if (Info.EarlyGameOver)
|
if (Info.EarlyGameOver)
|
||||||
|
{
|
||||||
foreach (var p in enemies)
|
foreach (var p in enemies)
|
||||||
{
|
{
|
||||||
p.WinState = WinState.Won;
|
p.WinState = WinState.Won;
|
||||||
p.World.OnPlayerWinStateChanged(p);
|
p.World.OnPlayerWinStateChanged(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CheckIfGameIsOver(player);
|
CheckIfGameIsOver(player);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user