Work around a crash for invalid FrozenActor targets.
This commit is contained in:
committed by
Oliver Brakmann
parent
6472840690
commit
8fc483b30b
@@ -540,6 +540,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public bool CanEnterTargetNow(Actor self, Target target)
|
public bool CanEnterTargetNow(Actor self, Target target)
|
||||||
{
|
{
|
||||||
|
if (target.Type == TargetType.FrozenActor && !target.FrozenActor.IsValid)
|
||||||
|
return false;
|
||||||
|
|
||||||
return self.Location == self.World.Map.CellContaining(target.CenterPosition) || Util.AdjacentCells(self.World, target).Any(c => c == self.Location);
|
return self.Location == self.World.Map.CellContaining(target.CenterPosition) || Util.AdjacentCells(self.World, target).Any(c => c == self.Location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user