fix dumbness in crushable support

This commit is contained in:
Chris Forbes
2010-01-27 11:50:11 +13:00
parent 09464ec4b4
commit 3a99bfd06f

View File

@@ -27,7 +27,8 @@ namespace OpenRa
public static bool IsActorCrushableByActor(this World world, Actor a, Actor b) public static bool IsActorCrushableByActor(this World world, Actor a, Actor b)
{ {
return world.IsActorCrushableByMovementType(a, b.traits.GetOrDefault<IMovement>().GetMovementType()); var movement = b.traits.GetOrDefault<IMovement>();
return movement != null && world.IsActorCrushableByMovementType(a, movement.GetMovementType());
} }
public static bool IsActorPathableToCrush(this World world, Actor a, UnitMovementType umt) public static bool IsActorPathableToCrush(this World world, Actor a, UnitMovementType umt)