Fix TilingPath bugs affecting unofficial mods
TilingPath had some bugs when working with single-point segments, which exist outside of the official mods. This change fixes a few problems: - Avoid unbounded length zero-cost, zero-progression loops that could be formed by an arbitrary number of single-point corners. These could pop up arbitrarily in the middle of paths. - Avoid zero-progression loops short-circuiting looped paths. - Fix missing end type matching during back-tracing stage. - Enhance lint check to ensure starts/ends have a valid directions. - Remove some dead code.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0b13ee3e49
commit
ad19506836
@@ -37,6 +37,13 @@ namespace OpenRA.Mods.Common.Lint
|
||||
foreach (var tile in multiBrush.PossibleTiles())
|
||||
if (!templatedTerrainInfo.TryGetTerrainInfo(tile, out var _))
|
||||
emitError($"Tileset {terrainInfoName} has invalid MultiBrush collection `{collectionName}`: tileset does not have tile {tile.Type},{tile.Index}");
|
||||
|
||||
if (multiBrush.Segment != null)
|
||||
{
|
||||
// Validate start and end have a direction.
|
||||
_ = multiBrush.Segment.StartDirection;
|
||||
_ = multiBrush.Segment.EndDirection;
|
||||
}
|
||||
}
|
||||
catch (Exception e) when (e is ArgumentException || e is InvalidOperationException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user