HedgeEditor: Fix health add/subtract not working for dud mines
authorWuzzy <almikes@aol.com>
Wed, 20 Apr 2016 18:18:05 +0200
changeset 12029 6191d8828254
parent 12028 cfc2f087dccf
child 12030 0d8c4e4ead8a
HedgeEditor: Fix health add/subtract not working for dud mines
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Wed Nov 23 14:08:43 2016 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Wed Apr 20 18:18:05 2016 +0200
@@ -1258,7 +1258,8 @@
 			elseif pMode[pIndex][2] == "mod" then
 				local _, oldHealth
 				_,_,_,_,_,_,_,_,_,_,_, oldHealth = GetGearValues(sGear)
-				local newHealth = math.max(1, oldHealth + tonumber(pMode[pIndex][1]))
+				oldHealth = 36 - oldHealth
+				newHealth = math.max(1, oldHealth + tonumber(pMode[pIndex][1]))
 			end
 			if newHealth ~= nil then
 				SetGearValues(sGear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 36 - newHealth)