From 4b308dee026a7a46336a2cfc344cd49484c49a00 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Fri, 5 Feb 2016 22:11:11 +0000 Subject: [PATCH] Remove checks for self being null in Mobile.cs. --- OpenRA.Mods.Common/Traits/Mobile.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index ee58b79697..d555e29eb7 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -179,7 +179,6 @@ namespace OpenRA.Mods.Common.Traits static bool IsMovingInMyDirection(Actor self, Actor other) { if (!other.IsMoving()) return false; - if (self == null) return true; var selfMobile = self.TraitOrDefault(); if (selfMobile == null) return false; @@ -235,7 +234,6 @@ namespace OpenRA.Mods.Common.Traits // If the check allows: we are not blocked by allied units moving in our direction. if (!check.HasCellCondition(CellConditions.BlockedByMovers) && - self != null && self.Owner.Stances[otherActor.Owner] == Stance.Ally && IsMovingInMyDirection(self, otherActor)) return false; @@ -246,7 +244,7 @@ namespace OpenRA.Mods.Common.Traits return false; // If we cannot crush the other actor in our way, we are blocked. - if (self == null || Crushes == null || Crushes.Count == 0) + if (Crushes == null || Crushes.Count == 0) return true; // If the other actor in our way cannot be crushed, we are blocked.