diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs index 01df69e..254a900 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs @@ -181,9 +181,7 @@ namespace InfectionFreeZone { if (Main.buildingDeconstructionResourcesMultiplier.Value <= 0) return; - if (Main.debug.Value) - Console.WriteLine($"Deconstruction resources is {__result}"); - + ResourceQuantity[] modifiedResult = new ResourceQuantity[__result.Length]; for (int i = 0; i < __result.Length; i++) { var resourceQuantity = __result[i]; if (Main.debug.Value) @@ -191,10 +189,14 @@ namespace InfectionFreeZone { if (Main.debug.Value) Console.WriteLine($"Resource quantity value is {resourceQuantity.value}"); - resourceQuantity.value *= Main.buildingDeconstructionResourcesMultiplier.Value; + modifiedResult[i] = new ResourceQuantity(resourceQuantity.resourceType, + resourceQuantity.value * Main.buildingDeconstructionResourcesMultiplier.Value); + // resourceQuantity.value *= Main.buildingDeconstructionResourcesMultiplier.Value; if (Main.debug.Value) Console.WriteLine($"Resource quantity value modified to {resourceQuantity.value}"); } + + __result = modifiedResult; } [HarmonyPostfix]