Always mark defeated/victorious players as spectating
This commit is contained in:
@@ -75,11 +75,19 @@ namespace OpenRA
|
|||||||
|
|
||||||
public WinState WinState = WinState.Undefined;
|
public WinState WinState = WinState.Undefined;
|
||||||
public bool HasObjectives = false;
|
public bool HasObjectives = false;
|
||||||
public bool Spectating;
|
|
||||||
|
public bool Spectating
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return spectating || WinState != WinState.Undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public World World { get; private set; }
|
public World World { get; private set; }
|
||||||
|
|
||||||
readonly bool inMissionMap;
|
readonly bool inMissionMap;
|
||||||
|
readonly bool spectating;
|
||||||
readonly IUnlocksRenderPlayer[] unlockRenderPlayer;
|
readonly IUnlocksRenderPlayer[] unlockRenderPlayer;
|
||||||
|
|
||||||
// Each player is identified with a unique bit in the set
|
// Each player is identified with a unique bit in the set
|
||||||
@@ -180,7 +188,7 @@ namespace OpenRA
|
|||||||
PlayerName = pr.Name;
|
PlayerName = pr.Name;
|
||||||
NonCombatant = pr.NonCombatant;
|
NonCombatant = pr.NonCombatant;
|
||||||
Playable = pr.Playable;
|
Playable = pr.Playable;
|
||||||
Spectating = pr.Spectating;
|
spectating = pr.Spectating;
|
||||||
BotType = pr.Bot;
|
BotType = pr.Bot;
|
||||||
Faction = ResolveFaction(world, pr.Faction, playerRandom, false);
|
Faction = ResolveFaction(world, pr.Faction, playerRandom, false);
|
||||||
DisplayFaction = ResolveDisplayFaction(world, pr.Faction);
|
DisplayFaction = ResolveDisplayFaction(world, pr.Faction);
|
||||||
@@ -188,7 +196,7 @@ namespace OpenRA
|
|||||||
SpawnPoint = DisplaySpawnPoint = 0;
|
SpawnPoint = DisplaySpawnPoint = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Spectating)
|
if (!spectating)
|
||||||
PlayerMask = new LongBitSet<PlayerBitMask>(InternalName);
|
PlayerMask = new LongBitSet<PlayerBitMask>(InternalName);
|
||||||
|
|
||||||
// Set this property before running any Created callbacks on the player actor
|
// Set this property before running any Created callbacks on the player actor
|
||||||
|
|||||||
@@ -249,10 +249,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Surrender")
|
if (order.OrderString == "Surrender")
|
||||||
{
|
|
||||||
ForceDefeat(self.Owner);
|
ForceDefeat(self.Owner);
|
||||||
self.Owner.Spectating = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user