From a90981988115b40169c508ae14c9156fa0334d13 Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 16 Feb 2022 18:55:18 +0400 Subject: [PATCH] Quickfix a crash --- .../api/mob_functions/projectile_handling.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/projectile_handling.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/projectile_handling.lua index a4b4c075e..bafb12737 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/projectile_handling.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/projectile_handling.lua @@ -28,12 +28,14 @@ mobs.shoot_projectile_handling = function(arrow_item, pos, dir, yaw, shooter, po obj:set_acceleration({x=0, y=gravity, z=0}) obj:set_yaw(yaw-math.pi/2) local le = obj:get_luaentity() - le._shooter = shooter - le._damage = damage - le._is_critical = is_critical - le._startpos = pos - le._knockback = knockback - le._collectable = collectable + if le then + le._shooter = shooter + le._damage = damage + le._is_critical = is_critical + le._startpos = pos + le._knockback = knockback + le._collectable = collectable + end --play custom shoot sound if shooter and shooter.shoot_sound then