Always mark defeated/victorious players as spectating

This commit is contained in:
abcdefg30
2020-10-24 16:53:59 +02:00
committed by abcdefg30
parent e7ce739fec
commit 6de1b7b915
2 changed files with 11 additions and 6 deletions

View File

@@ -75,11 +75,19 @@ namespace OpenRA
public WinState WinState = WinState.Undefined;
public bool HasObjectives = false;
public bool Spectating;
public bool Spectating
{
get
{
return spectating || WinState != WinState.Undefined;
}
}
public World World { get; private set; }
readonly bool inMissionMap;
readonly bool spectating;
readonly IUnlocksRenderPlayer[] unlockRenderPlayer;
// Each player is identified with a unique bit in the set
@@ -180,7 +188,7 @@ namespace OpenRA
PlayerName = pr.Name;
NonCombatant = pr.NonCombatant;
Playable = pr.Playable;
Spectating = pr.Spectating;
spectating = pr.Spectating;
BotType = pr.Bot;
Faction = ResolveFaction(world, pr.Faction, playerRandom, false);
DisplayFaction = ResolveDisplayFaction(world, pr.Faction);
@@ -188,7 +196,7 @@ namespace OpenRA
SpawnPoint = DisplaySpawnPoint = 0;
}
if (!Spectating)
if (!spectating)
PlayerMask = new LongBitSet<PlayerBitMask>(InternalName);
// Set this property before running any Created callbacks on the player actor

View File

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