Added cache for cell cost and blocking

This commit is contained in:
teinarss
2019-07-07 19:57:13 +02:00
committed by reaperrr
parent fb1af81280
commit cc84daacea
9 changed files with 305 additions and 102 deletions

View File

@@ -79,5 +79,15 @@ namespace OpenRA.Mods.Common.Traits
return Info.CrushClasses.Overlaps(crushClasses);
}
bool ICrushable.TryCalculatePlayerBlocking(Actor self, BitSet<CrushClass> crushClasses, out LongBitSet<PlayerBitMask> blocking)
{
if (IsTraitDisabled || !self.IsAtGroundLevel() || !Info.CrushClasses.Overlaps(crushClasses))
blocking = self.World.AllPlayerMask;
else
blocking = Info.CrushedByFriendlies ? default(LongBitSet<PlayerBitMask>) : self.Owner.AllyMask;
return true;
}
}
}