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
+9 -4
View File
@@ -10,20 +10,25 @@ public record struct CellIndex(int Value)
public int Value = Value;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public CellIndex(IntVec3 cell, Map map) : this(cell, map.cellIndices.mapSizeX) {}
public CellIndex(IntVec3 cell, Map map) : this(cell, map.Size.x) {}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public CellIndex(IntVec3 cell, int mapSizeX) : this(cell.CellToIndex(mapSizeX)) {}
public IntVec3 ToCell(Map map) => ToCell(map.cellIndices.mapSizeX);
public IntVec3 ToCell(Map map) => ToCell(map.Size.x);
public IntVec3 ToCell(int mapSizeX) => CellIndicesUtility.IndexToCell(Value, mapSizeX);
public List<Thing> GetThingList(Map map) => map.thingGrid.thingGrid[Value];
public bool IsFogged(Map map) => map.fogGrid.fogGrid[Value];
public bool IsFogged(Map map)
#if V1_6
=> map.fogGrid.fogGrid.IsSet(Value);
#else
=> map.fogGrid.fogGrid[Value];
#endif
public float GetSnowDepth(Map map) => map.snowGrid.depthGrid[Value];
public Building? GetEdifice(Map map) => map.edificeGrid[Value];
}
}