Merge pull request #11670 from evgeniysergeev/sandworm

Check that noiseDirection is not a zero
This commit is contained in:
Oliver Brakmann
2016-08-12 13:45:14 +02:00
committed by GitHub

View File

@@ -111,6 +111,13 @@ namespace OpenRA.Mods.D2k.Traits
while (!self.World.Map.Contains(moveTo) || !mobile.CanEnterCell(moveTo, null, false))
{
// without this check, this while can be infinity loop
if (moveTo == self.Location)
{
self.CancelActivity();
return;
}
noiseDirection /= 2;
moveTo = self.World.Map.CellContaining(self.CenterPosition + noiseDirection);
}