Remove the Stances dictionary
This commit is contained in:
@@ -207,30 +207,13 @@ namespace OpenRA
|
||||
Selection = WorldActor.Trait<ISelection>();
|
||||
OrderValidators = WorldActor.TraitsImplementing<IValidateOrder>().ToArray();
|
||||
|
||||
// Reset mask
|
||||
LongBitSet<PlayerBitMask>.Reset();
|
||||
|
||||
// Add players
|
||||
// Create an isolated RNG to simplify synchronization between client and server player faction/spawn assignments
|
||||
var playerRandom = new MersenneTwister(orderManager.LobbyInfo.GlobalSettings.RandomSeed);
|
||||
foreach (var cmp in WorldActor.TraitsImplementing<ICreatePlayers>())
|
||||
cmp.CreatePlayers(this, playerRandom);
|
||||
|
||||
// Set defaults for any unset stances
|
||||
foreach (var p in Players)
|
||||
{
|
||||
if (!p.Spectating)
|
||||
AllPlayersMask = AllPlayersMask.Union(p.PlayerMask);
|
||||
|
||||
foreach (var q in Players)
|
||||
{
|
||||
SetUpPlayerMask(p, q);
|
||||
|
||||
if (!p.Stances.ContainsKey(q))
|
||||
p.Stances[q] = PlayerRelationship.Neutral;
|
||||
}
|
||||
}
|
||||
|
||||
Game.Sound.SoundVolumeModifier = 1.0f;
|
||||
|
||||
gameInfo = new GameInformation
|
||||
@@ -245,25 +228,6 @@ namespace OpenRA
|
||||
RulesContainTemporaryBlocker = map.Rules.Actors.Any(a => a.Value.HasTraitInfo<ITemporaryBlockerInfo>());
|
||||
}
|
||||
|
||||
void SetUpPlayerMask(Player p, Player q)
|
||||
{
|
||||
if (q.Spectating)
|
||||
return;
|
||||
|
||||
var bitSet = q.PlayerMask;
|
||||
|
||||
switch (p.Stances[q])
|
||||
{
|
||||
case PlayerRelationship.Enemy:
|
||||
case PlayerRelationship.Neutral:
|
||||
p.EnemyPlayersMask = p.EnemyPlayersMask.Union(bitSet);
|
||||
break;
|
||||
case PlayerRelationship.Ally:
|
||||
p.AlliedPlayersMask = p.AlliedPlayersMask.Union(bitSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddToMaps(Actor self, IOccupySpace ios)
|
||||
{
|
||||
ActorMap.AddInfluence(self, ios);
|
||||
|
||||
Reference in New Issue
Block a user