Fix deconstruction materials infinitely duplicating
This commit is contained in:
@@ -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]
|
||||
|
Reference in New Issue
Block a user