The problem is that if you reclaim a feature with 0 metal and 0 energy, the feature will change to give NaN m/e (rez bot) or -2147483648 m/e (commander). During reclaiming the resource bar may also display an energy pull of -nan.
How to reproduce: Load therockjungle and reclaim some shrubs.
I suspect the bug is in here (LuaRules/Gadgets/unit_reclaim_fix.lua):
Code: Select all
local resource = math.max(FeatureDefs[featureDefID].metal,FeatureDefs[featureDefID].energy)
local newpercent = select(5,GetFeatureResources(featureID)) - ((((resource * oldformula) * 6) - (resource * newformula)) / resource)