Fixed an error

This commit is contained in:
npx 2016-11-12 15:47:02 +01:00
parent 40f322c9ee
commit c90e63d4c7

View File

@ -227,13 +227,15 @@ local function default_on_step(
if self.timer > 0.1 then if self.timer > 0.1 then
self.timer = 0 self.timer = 0
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
if (obj:get_entity_name() ~= self.object:get_luaentity().name) and (obj:get_luaentity().name ~= "__builtin:item") then if obj:get_luaentity() then
if obj:is_player() then if (obj:get_entity_name() ~= self.object:get_luaentity().name) and (obj:get_luaentity().name ~= "__builtin:item") then
obj:set_hp(obj:get_hp()-damage) if obj:is_player() then
elseif obj:get_luaentity().health then obj:set_hp(obj:get_hp()-damage)
obj:get_luaentity().health = obj:get_luaentity().health - damage elseif obj:get_luaentity().health then
--minetest.chat_send_all("Danneggiato: "..obj:get_entity_name().." Vita: "..obj:get_luaentity().health) obj:get_luaentity().health = obj:get_luaentity().health - damage
check_for_death(obj:get_luaentity()) --minetest.chat_send_all("Danneggiato: "..obj:get_entity_name().." Vita: "..obj:get_luaentity().health)
check_for_death(obj:get_luaentity())
end
end end
end end
end end