Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
authorWuzzy <almikes@aol.com>
Fri, 11 Sep 2015 03:50:32 +0200
changeset 11640 4865e715fb49
parent 11639 6733d6076915
child 11641 9edd7d5e32ac
Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Fri Sep 11 03:41:43 2015 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Fri Sep 11 03:50:32 2015 +0200
@@ -1640,7 +1640,8 @@
 	elseif cat[cIndex] == loc("Health Modification Mode") then
 
 		sGear = GetClosestGear()
-		if (sGear ~= nil) and (GetGearType(sGear) == gtHedgehog) then
+		local gt = GetGearType(sGear)
+		if gt == gtHedgehog or gt == gtExplosives or (gt == gtCase and GetGearPos(sGear) == 0x2) then
 			if pMode[pIndex][2] == "set" then
 				SetHealth(sGear, pMode[pIndex][1])
 			elseif pMode[pIndex][2] == "mod" then
@@ -1648,7 +1649,7 @@
 				SetHealth(sGear, newHealth)
 			end
 		else
-			AddCaption(loc("Please click on a hedgehog."),0xffba00ff,capgrpVolume)
+			AddCaption(loc("Please click on a hedgehog, barrel or health crate."),0xffba00ff,capgrpVolume)
 		end
 
 	elseif cat[cIndex] == loc("Sprite Modification Mode") then
@@ -3189,7 +3190,7 @@
 
 		ShowMission	(
 				loc("HEALTH MODIFICATION MODE"),
-				loc("Use this mode to set the health of hogs."),
+				loc("Use this mode to set the health of hogs, health crates and barrels."),
 				loc("Set Health: [Left Click]") .. "|" ..
 				loc("[Left], [Right]: Change health value.") .. "|" ..
 				" " .. "|" ..