replace deprecated get_entity_name()

master
tenplus1 2021-01-18 19:19:54 +00:00
parent 5e5f5d7382
commit d6f8cf271b
1 changed files with 8 additions and 3 deletions

View File

@ -224,12 +224,17 @@ local function default_on_step(
self.timer = 0
for _,obj in ipairs(objects) do
if obj:get_luaentity() then
if (obj:get_entity_name() ~= self.object:get_luaentity().name) and (obj:get_luaentity().name ~= "__builtin:item") then
if obj and obj:get_luaentity()
and obj:get_luaentity().name ~= self.object:get_luaentity().name
and obj:get_luaentity().name ~= "__builtin:item" then
if obj:is_player() then
obj:set_hp(obj:get_hp()-damage)
elseif obj:get_luaentity().health then
obj:get_luaentity().health = obj:get_luaentity().health - damage
--minetest.chat_send_all("Danneggiato: "..obj:get_entity_name().." Vita: "..obj:get_luaentity().health)
--minetest.chat_send_all("Danneggiato: "..obj:get_luaentity_name().." Vita: "..obj:get_luaentity().health)
-- check_for_death(obj:get_luaentity())
end
end
@ -1146,7 +1151,7 @@ if minetest.get_modpath("nssb") then
}
})
end
nssm_register_throwitem("water_column", "Water Column Bomb", {
hit_node = function(self,pos)
for dx = 0,0 do