From de1f8a7abccee029355be73ebde264ffdd539ece Mon Sep 17 00:00:00 2001 From: Raffson Date: Sat, 12 Apr 2025 17:24:23 +0200 Subject: [PATCH] Attempt to fix SplashDamage error w.r.t. line 604 Guard against event.target:getPosition() potentially being nil --- resources/plugins/splashdamage2/Splash_Damage_2_0.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/plugins/splashdamage2/Splash_Damage_2_0.lua b/resources/plugins/splashdamage2/Splash_Damage_2_0.lua index b823462f..494fe3fd 100644 --- a/resources/plugins/splashdamage2/Splash_Damage_2_0.lua +++ b/resources/plugins/splashdamage2/Splash_Damage_2_0.lua @@ -601,7 +601,6 @@ function onWpnEvent(event) local player = event.initiator local targetName = event.target:getTypeName() - local impactPoint = event.target:getPosition().p if weapon and targetName then env.info(weapon.." hit "..targetName) debugMsg(weapon.." hit "..targetName) @@ -610,7 +609,8 @@ function onWpnEvent(event) if clusterWeaps[weapon] then local ordnance = event.weapon tracked_weapons[event.weapon.id_] = { wpn = ordnance, init = event.initiator:getName(), pos = ordnance:getPoint(), dir = ordnance:getPosition().x, name = ordnance:getTypeName(), speed = ordnance:getVelocity(), cat = ordnance:getCategory(), player=event.initiator } - else + elseif event.target:getPosition() ~= nil then + local impactPoint = event.target:getPosition().p blastWave(impactPoint, splash_damage_options.blast_search_radius, event.weapon, getWeaponExplosive(weapon), player) end end