diff options
author | Joachim Stolberg <joe.stolberg@gmx.de> | 2017-11-01 16:35:25 +0100 |
---|---|---|
committer | Joachim Stolberg <joe.stolberg@gmx.de> | 2017-11-01 16:35:25 +0100 |
commit | 1ac183fbdf2e96641e897f54dcf231d9e94de7af (patch) | |
tree | 90d24c9d99786548a3ad103bb4d7fce9d8da5578 | |
parent | 14591aba9ceede2ca3cd76444906dc6c58f34cb7 (diff) |
v0.14 Crane handing over bugfix
-rw-r--r-- | init.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -3,7 +3,7 @@ Tower Crane Mod =============== - v0.13 by JoSt + v0.14 by JoSt Copyright (C) 2017 Joachim Stolberg LGPLv2.1+ @@ -23,6 +23,7 @@ 2017-09-09 v0.11 further player bugfixes 2017-09-24 v0.12 Switched from entity hook model to real fly privs 2017-10-17 v0.13 Area protection bugfix + 2017-11-01 v0.14 Crane handing over bugfix ]]-- @@ -112,6 +113,7 @@ local function fly_privs(player, enable) player:set_attribute("store_fast", minetest.serialize(privs["fast"])) player:set_attribute("store_fly", minetest.serialize(privs["fly"])) player:set_attribute("store_speed", minetest.serialize(physics.speed)) + player:set_attribute("crane_active", "true") privs["fly"] = true privs["fast"] = nil physics.speed = 0.7 @@ -119,6 +121,7 @@ local function fly_privs(player, enable) privs["fast"] = minetest.deserialize(player:get_attribute("store_fast")) privs["fly"] = minetest.deserialize(player:get_attribute("store_fly")) physics.speed = minetest.deserialize(player:get_attribute("store_speed")) + player:set_attribute("crane_active", nil) end player:set_physics_override(physics) minetest.set_player_privs(player:get_player_name(), privs) @@ -600,6 +603,10 @@ minetest.register_node("towercrane:mast_ctrl_off", { if clicker:get_player_name() ~= meta:get_string("owner") then return end + -- prevent handing over to the next crane + if clicker:get_attribute("crane_active") ~= nil then + return + end -- swap to the other node node.name = "towercrane:mast_ctrl_on" minetest.swap_node(pos, node) |