project_files/Android-build/SDL-android-project/assets/Data/Scripts/Multiplayer/No_Jumping.lua
author Wuzzy <Wuzzy2@mail.ru>
Sat, 12 Jan 2019 23:26:33 +0100
changeset 14565 45c6c12c12e2
parent 7568 75ba91f14ed5
permissions -rw-r--r--
Fix wrong ice beam angle if it goes diagonally up out of map thru world wrap (bug #718)

--------------------------------
-- 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