Maybe fix bug with infinite resource duplication on deconstruct
This commit is contained in:
@@ -180,7 +180,7 @@ namespace InfectionFreeZone {
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(Building), "DeconstructionResources", MethodType.Getter)]
|
||||
public static void PostfixDeconstructionResources(ref ResourceQuantity[] __result) {
|
||||
public static ResourceQuantity[] PostfixDeconstructionResources(ResourceQuantity[] __result) {
|
||||
if (Main.buildingDeconstructionResourcesMultiplier.Value <= 0)
|
||||
return;
|
||||
|
||||
@@ -196,10 +196,10 @@ namespace InfectionFreeZone {
|
||||
resourceQuantity.value * Main.buildingDeconstructionResourcesMultiplier.Value);
|
||||
// resourceQuantity.value *= Main.buildingDeconstructionResourcesMultiplier.Value;
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine($"Resource quantity value modified to {resourceQuantity.value}");
|
||||
Console.WriteLine($"Resource quantity value modified to {modifiedResult[i].value}");
|
||||
}
|
||||
|
||||
__result = modifiedResult;
|
||||
return modifiedResult;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
|
||||
Reference in New Issue
Block a user