Work around a crash for invalid FrozenActor targets.

This commit is contained in:
Paul Chote
2019-03-05 18:37:01 +00:00
committed by Oliver Brakmann
parent 6472840690
commit 8fc483b30b

View File

@@ -540,6 +540,9 @@ namespace OpenRA.Mods.Common.Traits
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);
}