share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author Vatten
Tue, 30 Oct 2012 18:01:11 -0400
branch0.9.18
changeset 7895 ac1610a7b7fa
parent 5827 a416f1070fdf
child 8043 da083f8d95e6
permissions -rw-r--r--
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.

--------------------------------
-- NO JUMPING
--------------------------------

loadfile(GetDataPath() .. "Scripts/Locale.lua")()

local specialGear = nil

function onGameInit()
    Goals = loc("Jumping is disabled")
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