add 1.6 support and fix prepatch regressions

This commit is contained in:
localavaster
2026-04-07 03:56:12 -06:00
parent a99972001e
commit c020968638
32 changed files with 609 additions and 158 deletions
@@ -97,7 +97,7 @@ public static class MiscExtensions
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int SizeX(this Map map) => map.cellIndices.mapSizeX;
public static int SizeX(this Map map) => map.Size.x;
public static Map? TryGetMapHeld(this Thing thing)
{
@@ -134,10 +134,18 @@ public static class MiscExtensions
public static void InvokeWhenCellIndicesReady(this Map map, Action<Map> action)
{
#if V1_6
if (map.cellIndices.NumGridCells > 0)
#else
if (map.cellIndices != null)
#endif
{
action(map);
}
else
{
map.Events().ComponentsConstructed += action;
}
}
public static void AddLetterSilently(this LetterStack letterStack, Letter letter, Color color, bool playSound = false,
@@ -164,4 +172,4 @@ public static class MiscExtensions
letterStack.letters.Add(letter);
letter.Received();
}
}
}