UmbraSpaceIndustries / USITools

Shared components for KSP mods
Other
39 stars 38 forks source link

Nuclear refinery destroys machinery in some circumstances -- proposed fix included #51

Closed langabi closed 8 years ago

langabi commented 8 years ago

When the nuclear refinery has less than required machinery, it can sometimes destroy machinery when it receives automated maintenance, as a result of being both a target for automated maintenance, and a warehouse. Specifically, this means that in lines 153-156 of UmbraSpaceIndustries/USITools/USITools/Logistics/USI_ModuleFieldRepair.cs, both part and whp can be referring to the same nuclear refinery, and so the refinery will fetch machinery from itself and then (line 156) set its machinery levels to zero.

Fix is to exclude the part itself from the whp list, i.e., line 141 of UmbraSpaceIndustries/USITools/USITools/Logistics/USI_ModuleFieldRepair.cs, add a condition: part != whp

I don't know exact cs syntax, sorry.

langabi commented 8 years ago

The forum post this bug fixes is http://forum.kerbalspaceprogram.com/index.php?/topic/72032-105-usi-kolonization-systems-mksoks-0339-planetary-logistics-and-kolony-rewards/&do=findComment&comment=2472787

BobPalmer commented 8 years ago

Fixed in next release