Fixes on blocking logic

This commit is contained in:
teinarss
2019-08-01 20:02:42 +02:00
committed by reaperrr
parent 98602cb1cb
commit 277906c657
9 changed files with 121 additions and 134 deletions

View File

@@ -76,8 +76,8 @@ namespace OpenRA
// Each player is identified with a unique bit in the set
// Cache masks for the player's index and ally/enemy player indices for performance.
public LongBitSet<PlayerBitMask> PlayerMask;
public LongBitSet<PlayerBitMask> AllyMask = default(LongBitSet<PlayerBitMask>);
public LongBitSet<PlayerBitMask> EnemyMask = default(LongBitSet<PlayerBitMask>);
public LongBitSet<PlayerBitMask> AlliedPlayersMask = default(LongBitSet<PlayerBitMask>);
public LongBitSet<PlayerBitMask> EnemyPlayersMask = default(LongBitSet<PlayerBitMask>);
public bool UnlockedRenderPlayer
{

View File

@@ -260,7 +260,7 @@ namespace OpenRA.Traits
WDist LargestActorRadius { get; }
WDist LargestBlockingActorRadius { get; }
event Action<IEnumerable<CPos>> CellsUpdated;
event Action<CPos> CellUpdated;
}
[RequireExplicitImplementation]

View File

@@ -43,7 +43,8 @@ namespace OpenRA
public readonly MersenneTwister SharedRandom;
public readonly MersenneTwister LocalRandom;
public readonly IModelCache ModelCache;
public LongBitSet<PlayerBitMask> AllPlayerMask = default(LongBitSet<PlayerBitMask>);
public LongBitSet<PlayerBitMask> AllPlayersMask = default(LongBitSet<PlayerBitMask>);
public readonly LongBitSet<PlayerBitMask> NoPlayersMask = default(LongBitSet<PlayerBitMask>);
public Player[] Players = new Player[0];
@@ -208,7 +209,7 @@ namespace OpenRA
foreach (var p in Players)
{
if (!p.Spectating)
AllPlayerMask = AllPlayerMask.Union(p.PlayerMask);
AllPlayersMask = AllPlayersMask.Union(p.PlayerMask);
foreach (var q in Players)
{
@@ -244,10 +245,10 @@ namespace OpenRA
{
case Stance.Enemy:
case Stance.Neutral:
p.EnemyMask = p.EnemyMask.Union(bitSet);
p.EnemyPlayersMask = p.EnemyPlayersMask.Union(bitSet);
break;
case Stance.Ally:
p.AllyMask = p.AllyMask.Union(bitSet);
p.AlliedPlayersMask = p.AlliedPlayersMask.Union(bitSet);
break;
}
}