diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs b/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs index 553d775bb6..ea65041f5f 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithBuildingBib.cs @@ -58,9 +58,15 @@ namespace OpenRA.Mods.Cnc.Traits var cell = location + cellOffset; // Some mods may define terrain-specific bibs - var terrain = map.GetTerrainInfo(cell).Type; - var testSequence = Sequence + "-" + terrain; - var sequence = anim.HasSequence(testSequence) ? testSequence : Sequence; + var sequence = Sequence; + if (map.Tiles.Contains(cell)) + { + var terrain = map.GetTerrainInfo(cell).Type; + var testSequence = Sequence + "-" + terrain; + if (anim.HasSequence(testSequence)) + sequence = testSequence; + } + anim.PlayFetchIndex(sequence, () => index); anim.IsDecoration = true; diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs index cb3313f0b4..f156094706 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs @@ -263,8 +263,16 @@ namespace OpenRA.Mods.Common.Traits return map.Grid.DefaultSubCell; for (var i = (byte)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++) - if (!previews.Any(p => p.Footprint[cell] == (SubCell)i)) + { + var blocked = previews.Any(p => + { + SubCell s; + return p.Footprint.TryGetValue(cell, out s) && s == (SubCell)i; + }); + + if (!blocked) return (SubCell)i; + } return SubCell.Invalid; }