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
end
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
local node_head = minetest.get_node(pos).name
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
minetest.after(ARMOR_BONES_DELAY, function()
local node = minetest.get_node(vector.round(pos))
if node then
if node.name == "bones:bones" then
local meta = minetest.get_meta(vector.round(pos))
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
if node and node.name == "bones:bones" then
local meta = minetest.get_meta(vector.round(pos))
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
end
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 /!\
---Next merge--- (Remerciements : ???)
MaJ de "3d_armor" (drop des armurs fixé)
MaJ de "homedecor" (nouveaux panneaux colorés)
MaJ de "plantlife"
MaJ de "mesecons"