Fix a crash in LegacyBridgeLayer

This commit is contained in:
abcdefg30
2020-06-02 12:04:29 +02:00
committed by Paul Chote
parent f58c3aed32
commit 507ce40ad2

View File

@@ -89,9 +89,12 @@ namespace OpenRA.Mods.Common.Traits
// Where do we expect to find the subtile
var subtile = new CPos(ni + ind % template.Size.X, nj + ind / template.Size.X);
if (!mapTiles.Contains(subtile))
continue;
// This isn't the bridge you're looking for
var subti = mapTiles[subtile];
if (!mapTiles.Contains(subtile) || subti.Type != tile || subti.Index != ind)
if (subti.Type != tile || subti.Index != ind)
continue;
subTiles.Add(subtile, ind);