Add Map.DistanceAboveTerrain(WPos) and Actor.IsAtGroundLevel() extension method

This commit is contained in:
Taryn Hill
2015-08-01 07:53:14 -05:00
parent 7066254887
commit 6fa1f757b0
8 changed files with 36 additions and 13 deletions

View File

@@ -65,8 +65,8 @@ namespace OpenRA.Mods.Common.Traits
public bool CrushableBy(string[] crushClasses, Player crushOwner)
{
// Only make actor crushable if it is on the ground
if (self.CenterPosition.Z != 0)
// Only make actor crushable if it is on the ground.
if (!self.IsAtGroundLevel())
return false;
if (!info.CrushedByFriendlies && crushOwner.IsAlliedWith(self.Owner))