share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
changeset 5571 434ec40070e0
parent 5325 261b79ba22b1
child 5827 a416f1070fdf
--- a/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Mon Aug 15 10:16:18 2011 -0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Mon Aug 15 17:29:54 2011 +0200
@@ -4,17 +4,31 @@
 
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 
+local specialGear = nil
+
 function onGameInit()
     Goals = loc("Jumping is disabled")
 end
 
---function onGameStart()
---	ShowMission(LOC_NOT("NO JUMPING"), LOC_NOT("- Jumping is disabled"), LOC_NOT("Good luck out there!"), 0, 0)
---end
-
 function onNewTurn()
 	SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
 end
 
+function onGearAdd(gear)
+	
+	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
+		specialGear = gear
+		SetInputMask(band(0xFFFFFFFF, bnot(gmHJump)))
+	end
 
+end
 
+function onGearDelete(gear)
+
+	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
+		specialGear = nil
+		SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
+	end
+
+end
+