Merge pull request #75 from NachoToast/main

Fix duplicate deadlife dust label at the bottom left and in the add gas menu
This commit is contained in:
bbradson
2025-03-22 16:15:39 +01:00
committed by GitHub
3 changed files with 13 additions and 3 deletions
+3
View File
@@ -20,6 +20,9 @@ public class GasDef : Def
GasType.BlindSmoke => GasDefOf.BlindSmoke, GasType.BlindSmoke => GasDefOf.BlindSmoke,
GasType.RotStink => GasDefOf.RotStink, GasType.RotStink => GasDefOf.RotStink,
GasType.ToxGas => GasDefOf.ToxGas, GasType.ToxGas => GasDefOf.ToxGas,
#if !V1_4
GasType.DeadlifeDust => GasDefOf.DeadLifeDust,
#endif
_ => null _ => null
}; };
} }
@@ -26,6 +26,13 @@ namespace PerformanceFish;
public sealed class GasGridOptimization : ClassWithFishPrepatches public sealed class GasGridOptimization : ClassWithFishPrepatches
{ {
private const int START_INDEX
#if V1_4
= 3;
#else
= 4;
#endif
public sealed class SetDirectPatch : FishPrepatch public sealed class SetDirectPatch : FishPrepatch
{ {
public override bool ShowSettings => false; public override bool ShowSettings => false;
@@ -493,7 +500,7 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches
{ {
var gasDefs = DefDatabase<GasDef>.AllDefsListForReading; var gasDefs = DefDatabase<GasDef>.AllDefsListForReading;
for (var i = 3; i < gasDefs.Count; i++) for (var i = START_INDEX; i < gasDefs.Count; i++)
{ {
var gasDef = gasDefs[i]; var gasDef = gasDefs[i];
@@ -550,7 +557,7 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches
var gasGrids = map.gasGrid.ParallelGasGrids(); var gasGrids = map.gasGrid.ParallelGasGrids();
var cellIndex = new CellIndex(cell, map); var cellIndex = new CellIndex(cell, map);
for (var i = 3; i < gasGrids.Length; i++) for (var i = START_INDEX; i < gasGrids.Length; i++)
{ {
var gasGrid = gasGrids[i]; var gasGrid = gasGrids[i];
if (!gasGrid.AnyGasAt(cellIndex)) if (!gasGrid.AnyGasAt(cellIndex))