From fc84cd9204de49543211840b9eb01147de2feef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 20 Apr 2020 17:46:33 +0200 Subject: [PATCH] Add an is in world check to fix a crash. --- OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs index 9586d5d266..c290dbb84a 100644 --- a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs +++ b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs @@ -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)