Compare commits

..

7 Commits

2 changed files with 1 additions and 11 deletions

View File

@ -731,16 +731,6 @@ function mcl_util.get_entity_id(entity)
return id return id
end end
end end
function mcl_util.get_entity_from_id(id)
local player = minetest.get_player_by_name(id)
if player then return player end
for i,le in pairs(minetest.luaentities) do
if le._uuid == id then return le.object end
end
return nil
end
function mcl_util.remove_entity(luaentity) function mcl_util.remove_entity(luaentity)
if luaentity._removed then return end if luaentity._removed then return end
luaentity._removed = true luaentity._removed = true

View File

@ -484,7 +484,7 @@ local function handle_entity_collision(self, entity_def, projectile_def, object)
dmg = dmg(self, entity_def, projectile_def, object) dmg = dmg(self, entity_def, projectile_def, object)
end end
mcl_util.deal_damage(object, dmg.fleshy, {type = projectile_def.damage_type or "arrow", source = mcl_util.get_entity_from_id(self._owner), direct = self.object}) object:punch(self.object, 1.0, projectile_def.tool or { full_punch_interval = 1.0, damage_groups = dmg }, dir )
-- Guard against crashes when projectiles get destroyed in response to what it punched -- Guard against crashes when projectiles get destroyed in response to what it punched
if not self.object:get_pos() then return true end if not self.object:get_pos() then return true end