Add an is in world check to fix a crash.

This commit is contained in:
Matthias Mailänder
2020-04-20 17:46:33 +02:00
committed by atlimit8
parent e361f7b246
commit fc84cd9204

View File

@@ -111,6 +111,9 @@ namespace OpenRA.Mods.Common.Traits.Render
if (++ticks >= cachedInterval)
{
var spawnCell = Info.SpawnAtLastPosition ? self.World.Map.CellContaining(cachedPosition) : self.World.Map.CellContaining(self.CenterPosition);
if (!self.World.Map.Contains(spawnCell))
return;
var type = self.World.Map.GetTerrainInfo(spawnCell).Type;
if (++offset >= Info.Offsets.Length)