From c93f0f9c27e4a6d136288fcce5f8e199ee3d8758 Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:17:25 +1300 Subject: [PATCH 1/6] increase start index in custom gas drawing loop --- Source/PerformanceFish/GasGridOptimization.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/PerformanceFish/GasGridOptimization.cs b/Source/PerformanceFish/GasGridOptimization.cs index 0605bf8..a602517 100644 --- a/Source/PerformanceFish/GasGridOptimization.cs +++ b/Source/PerformanceFish/GasGridOptimization.cs @@ -550,7 +550,7 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches var gasGrids = map.gasGrid.ParallelGasGrids(); var cellIndex = new CellIndex(cell, map); - for (var i = 3; i < gasGrids.Length; i++) + for (var i = 4; i < gasGrids.Length; i++) { var gasGrid = gasGrids[i]; if (!gasGrid.AnyGasAt(cellIndex)) From 11b5ea1670d6268741f149b9996e2fb88576ca7e Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:23:50 +1300 Subject: [PATCH 2/6] fix deadlife dust label --- Defs/GasDefs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Defs/GasDefs.xml b/Defs/GasDefs.xml index 58b3de0..9e6c615 100644 --- a/Defs/GasDefs.xml +++ b/Defs/GasDefs.xml @@ -26,7 +26,7 @@ DeadLifeDust - + 3 true (3,13,51) From e3c5e0dc8520f1da3ec09bdb32a29cd954840b79 Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:24:21 +1300 Subject: [PATCH 3/6] add deadlife dust to `GasDef.OfGasType` method --- Source/PerformanceFish/GasDef.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/PerformanceFish/GasDef.cs b/Source/PerformanceFish/GasDef.cs index f5422eb..4293596 100644 --- a/Source/PerformanceFish/GasDef.cs +++ b/Source/PerformanceFish/GasDef.cs @@ -20,6 +20,9 @@ public class GasDef : Def GasType.BlindSmoke => GasDefOf.BlindSmoke, GasType.RotStink => GasDefOf.RotStink, GasType.ToxGas => GasDefOf.ToxGas, +#if !V1_4 + GasType.DeadlifeDust => GasDefOf.DeadLifeDust, +#endif _ => null }; } \ No newline at end of file From 083d73d31d061b8815ac1f2bb3b47005dcb61ae3 Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:24:52 +1300 Subject: [PATCH 4/6] add version check to patch --- Source/PerformanceFish/GasGridOptimization.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/PerformanceFish/GasGridOptimization.cs b/Source/PerformanceFish/GasGridOptimization.cs index a602517..e27b378 100644 --- a/Source/PerformanceFish/GasGridOptimization.cs +++ b/Source/PerformanceFish/GasGridOptimization.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 bradson +// Copyright (c) 2023 bradson // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. @@ -26,6 +26,13 @@ namespace PerformanceFish; public sealed class GasGridOptimization : ClassWithFishPrepatches { + private const int START_INDEX +#if V1_4 + = 3; +#else + = 4; +#endif + public sealed class SetDirectPatch : FishPrepatch { public override bool ShowSettings => false; @@ -550,7 +557,7 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches var gasGrids = map.gasGrid.ParallelGasGrids(); var cellIndex = new CellIndex(cell, map); - for (var i = 4; i < gasGrids.Length; i++) + for (var i = START_INDEX; i < gasGrids.Length; i++) { var gasGrid = gasGrids[i]; if (!gasGrid.AnyGasAt(cellIndex)) From d0036e46a40ae25c3e23f6a06845f3dd16acfce7 Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:25:15 +1300 Subject: [PATCH 5/6] fix deadlife dust display twice in 'add gas' debug menu --- Source/PerformanceFish/GasGridOptimization.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/PerformanceFish/GasGridOptimization.cs b/Source/PerformanceFish/GasGridOptimization.cs index e27b378..48d90ce 100644 --- a/Source/PerformanceFish/GasGridOptimization.cs +++ b/Source/PerformanceFish/GasGridOptimization.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 bradson +// Copyright (c) 2023 bradson // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. @@ -500,7 +500,7 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches { var gasDefs = DefDatabase.AllDefsListForReading; - for (var i = 3; i < gasDefs.Count; i++) + for (var i = START_INDEX; i < gasDefs.Count; i++) { var gasDef = gasDefs[i]; From 6e43ee479f713f78721344188ec54bc89ea62fbf Mon Sep 17 00:00:00 2001 From: NachoToast <32235595+NachoToast@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:29:48 +1300 Subject: [PATCH 6/6] fix indentation --- Source/PerformanceFish/GasGridOptimization.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/PerformanceFish/GasGridOptimization.cs b/Source/PerformanceFish/GasGridOptimization.cs index 48d90ce..3b5e3bf 100644 --- a/Source/PerformanceFish/GasGridOptimization.cs +++ b/Source/PerformanceFish/GasGridOptimization.cs @@ -28,9 +28,9 @@ public sealed class GasGridOptimization : ClassWithFishPrepatches { private const int START_INDEX #if V1_4 - = 3; + = 3; #else - = 4; + = 4; #endif public sealed class SetDirectPatch : FishPrepatch