Compare commits
7 Commits
aafd806e89
...
1c7d727286
Author | SHA1 | Date |
---|---|---|
teknomunk | 1c7d727286 | |
teknomunk | 9061df8adf | |
teknomunk | a03aa6065b | |
teknomunk | 6a1b8d0f09 | |
teknomunk | 2fec9696b6 | |
teknomunk | 27f0f8b52b | |
teknomunk | 74ce69e3f0 |
|
@ -731,16 +731,6 @@ function mcl_util.get_entity_id(entity)
|
|||
return id
|
||||
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)
|
||||
if luaentity._removed then return end
|
||||
luaentity._removed = true
|
||||
|
|
|
@ -484,7 +484,7 @@ local function handle_entity_collision(self, entity_def, projectile_def, object)
|
|||
dmg = dmg(self, entity_def, projectile_def, object)
|
||||
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
|
||||
if not self.object:get_pos() then return true end
|
||||
|
|
Loading…
Reference in New Issue