Fix bones not being removed
parent
f6872d7b3b
commit
533c0f6dbb
|
@ -164,28 +164,24 @@ minetest.register_node("bones:bones", {
|
|||
on_timer = function(pos, elapsed)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local time = meta:get_int("time")+elapsed
|
||||
local publish = 1200
|
||||
local delete = 2400
|
||||
if tonumber(minetest.setting_get("share_bones_time")) then
|
||||
publish = tonumber(minetest.setting_get("share_bones_time"))
|
||||
end
|
||||
if publish == 0 then
|
||||
return
|
||||
end
|
||||
if time >= publish then
|
||||
meta:set_int("time",time)
|
||||
local publish = 1800
|
||||
local delete = 7200
|
||||
|
||||
if time >= publish and meta:get_string("owner") ~= "" then
|
||||
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
|
||||
meta:set_string("owner", "")
|
||||
return
|
||||
end
|
||||
|
||||
if time >= delete then
|
||||
inv = meta:get_inventory()
|
||||
local inv = meta:get_inventory()
|
||||
if inv:is_empty("main") == false then
|
||||
dump_bones(pos)
|
||||
end
|
||||
minetest.remove_node(pos)
|
||||
minetest.after(5,minetest.remove_node,pos)
|
||||
player_bones[meta:get_string("owner")] = nil
|
||||
default.serialize_to_file(bone_file,player_bones)
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
|
|
|
@ -376,10 +376,10 @@ function default.drop_item(pos,itemstack,vel,acc)
|
|||
local x = math.random(0, 15)/10 - 0.5
|
||||
local z = math.random(0, 15)/10 - 0.5
|
||||
--local y = math.random(0, 15)/10 - 2
|
||||
local np = pos
|
||||
np.x = np.x + x
|
||||
np.z = np.z + z
|
||||
np.y = np.y + .25
|
||||
local np = { }
|
||||
np.x = pos.x + x
|
||||
np.z = pos.z + z
|
||||
np.y = pos.y + .25
|
||||
local obj = minetest.add_item(np, itemstack)
|
||||
if obj then
|
||||
obj:get_luaentity().collect = true
|
||||
|
|
|
@ -83,6 +83,7 @@ local spider_poison = {
|
|||
ny = ny * 0.15
|
||||
end
|
||||
player:set_look_yaw(ny)
|
||||
minetest.chat_send_player(name,"You feel a little dizzy")
|
||||
end}
|
||||
},
|
||||
{
|
||||
|
@ -101,6 +102,7 @@ local spider_poison = {
|
|||
h = h - 2
|
||||
hunger.update_hunger(player,h)
|
||||
player_energy[name] = player_energy[name] - 2
|
||||
minetest.chat_send_player(name,"You feel a very dizzy")
|
||||
end
|
||||
},
|
||||
},
|
||||
|
@ -123,6 +125,7 @@ local spider_poison = {
|
|||
if randomChance(40) then
|
||||
pass_out(name,player)
|
||||
end
|
||||
minetest.chat_send_player(name,"You can hardly stand...")
|
||||
end
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue