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

@@ -59,11 +59,13 @@ namespace OpenRA.Mods.Cnc.Traits
return info.CrushClasses.Overlaps(crushClasses);
}
bool ICrushable.TryCalculatePlayerBlocking(Actor self, BitSet<CrushClass> crushClasses, out LongBitSet<PlayerBitMask> blocking)
LongBitSet<PlayerBitMask> ICrushable.CrushableBy(Actor self, BitSet<CrushClass> crushClasses)
{
// Fall back to the slow path
blocking = default(LongBitSet<PlayerBitMask>);
return false;
if (!info.CrushClasses.Overlaps(crushClasses))
return self.World.NoPlayersMask;
// Friendly units should move around!
return info.BlockFriendly ? self.Owner.EnemyPlayersMask : self.World.AllPlayersMask;
}
}