From 7a204cbdb1cfb447867a209fbbee0ab4e9522c84 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Jul 2015 19:48:52 -0500 Subject: [PATCH] #1843 - HuntIR - Handle Dead Projectile --- addons/huntir/functions/fnc_handleFired.sqf | 6 ++++++ addons/huntir/script_component.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index 23c7df04f0..121cd9fd12 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -25,6 +25,12 @@ if (_ammo != "F_HuntIR") exitWith {}; [{ PARAMS_1(_projectile); + + //If null (deleted or hit water) exit: + if (isNull _projectile) exitWith {}; + //If it's not spinning (hit ground), bail: + if ((vectorMagnitude (velocity _projectile)) < 0.1) exitWith {}; + "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); [{ PARAMS_1(_position); diff --git a/addons/huntir/script_component.hpp b/addons/huntir/script_component.hpp index 9f99437f67..385c0985ae 100644 --- a/addons/huntir/script_component.hpp +++ b/addons/huntir/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT huntir #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_HUNTIR #define DEBUG_MODE_FULL #endif