1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-17 07:50:29 +01:00

Updated 3d_armor and fixed armors' drop

- Fixed a mistake in code from @stujones11 repository about bones' drop : when
   the function assigned to minetest.after looks for bones, it first looks for
   a node. If there is a node, it looks for bones, if this node isn't bones, it
   just does nothing. Howevere, you're sure to get a node, because minetest.get_node
   will even return air and ignore, so, the else case, where every item is dropped,
   will never happen.
This commit is contained in:
LeMagnesium 2015-06-28 14:12:31 +02:00
parent eaf7d1460e
commit fe2bf3e822
2 changed files with 11 additions and 12 deletions

View File

@ -247,7 +247,7 @@ armor.update_armor = function(self, player, dtime)
return return
end end
local hp = player:get_hp() or 0 local hp = player:get_hp() or 0
if ARMOR_FIRE_PROTECT == true then if ARMOR_FIRE_PROTECT == true and dtime then
pos.y = pos.y + 1.4 -- head level pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level pos.y = pos.y - 1.2 -- feet level
@ -596,17 +596,15 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
if ARMOR_DESTROY == false then if ARMOR_DESTROY == false then
minetest.after(ARMOR_BONES_DELAY, function() minetest.after(ARMOR_BONES_DELAY, function()
local node = minetest.get_node(vector.round(pos)) local node = minetest.get_node(vector.round(pos))
if node then if node and node.name == "bones:bones" then
if node.name == "bones:bones" then local meta = minetest.get_meta(vector.round(pos))
local meta = minetest.get_meta(vector.round(pos)) local owner = meta:get_string("owner")
local owner = meta:get_string("owner") local inv = meta:get_inventory()
local inv = meta:get_inventory() for _,stack in ipairs(drop) do
for _,stack in ipairs(drop) do if name == owner and inv:room_for_item("main", stack) then
if name == owner and inv:room_for_item("main", stack) then inv:add_item("main", stack)
inv:add_item("main", stack) else
else armor.drop_armor(pos, stack)
armor.drop_armor(pos, stack)
end
end end
end end
else else

View File

@ -5,6 +5,7 @@ News de FR - MinetestForFun (Survival - PVP - Hardcore)
/!\ En effet, nous profitons de cette stabilitée pour préparer une grosse MAJ qui boulversera à jamais le gameplay de Minetest /!\ /!\ En effet, nous profitons de cette stabilitée pour préparer une grosse MAJ qui boulversera à jamais le gameplay de Minetest /!\
---Next merge--- (Remerciements : ???) ---Next merge--- (Remerciements : ???)
MaJ de "3d_armor" (drop des armurs fixé)
MaJ de "homedecor" (nouveaux panneaux colorés) MaJ de "homedecor" (nouveaux panneaux colorés)
MaJ de "plantlife" MaJ de "plantlife"
MaJ de "mesecons" MaJ de "mesecons"