summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@linux-forks.de>2018-08-22 21:46:41 +0200
committerroot <root@linux-forks.de>2018-08-22 21:46:41 +0200
commitbf0676fbf54e27a4a4cabef0d580f27fb35e3329 (patch)
treed7f94eb1a850cf2886204758d4b03b0dfa457bab
parentdd13f134fbce8ab7f1cc4a8fed6af8ce28f65359 (diff)
parent5f692ee6c48ca137d24f05fac655efb02244bbee (diff)
Merge branch 'master' of https://github.com/joe7575/Minetest-TowercraneHEADmaster
-rw-r--r--init.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index dec6498..a73579e 100644
--- a/init.lua
+++ b/init.lua
@@ -290,8 +290,8 @@ local function construct_crane(pos, dir, height, width, owner)
local meta = minetest.get_meta(pos)
meta:set_string("dir", minetest.pos_to_string(dir))
meta:set_string("owner", owner)
- meta:set_int("height", height)
- meta:set_int("width", width)
+ meta:set_int("height", height or 0)
+ meta:set_int("width", width or 0)
end
----------------------------------------------------------------------------------------------------
@@ -450,12 +450,9 @@ minetest.register_node("towercrane:base", {
if no_area_violation(owner, pos) then
if dir ~= nil then
if check_space(table.copy(pos), dir, height, width, owner) then
- -- add protection area
- id = protect_area(table.copy(pos), table.copy(dir), height, width, owner)
- if id ~= nil then
- meta:set_int("id", id)
+ -- add protection area
+ meta:set_int("id", protect_area(table.copy(pos), table.copy(dir), height, width, owner) or 0)
construct_crane(table.copy(pos), table.copy(dir), height, width, owner)
- end
else
chat(owner, "area is protected or too less space to raise up the crane!")
end