fix marking player as spectator going through unsynced code

This commit is contained in:
Matthias Mailänder
2015-08-03 10:28:32 +02:00
parent 1eb46d4922
commit bbb186d9c8
2 changed files with 3 additions and 1 deletions

View File

@@ -238,7 +238,10 @@ namespace OpenRA.Mods.Common.Traits
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "Surrender")
{
ForceDefeat(self.Owner);
self.Owner.Spectating = true;
}
}
}

View File

@@ -38,7 +38,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (world.LocalPlayer.WinState != WinState.Undefined)
Game.RunAfterDelay(objectives != null ? objectives.Info.GameOverDelay : 0, () =>
{
world.LocalPlayer.Spectating = true;
playerRoot.RemoveChildren();
Game.LoadWidget(world, "OBSERVER_WIDGETS", playerRoot, new WidgetArgs());
});