diff --git a/addons/hitreactions/XEH_PREP.hpp b/addons/hitreactions/XEH_PREP.hpp index 7d037789ca..53f2d60eb6 100644 --- a/addons/hitreactions/XEH_PREP.hpp +++ b/addons/hitreactions/XEH_PREP.hpp @@ -1,4 +1,4 @@ -PREP(throwWeapon); PREP(fallDown); PREP(getRandomAnimation); +PREP(throwWeapon); diff --git a/addons/hitreactions/functions/fnc_throwWeapon.sqf b/addons/hitreactions/functions/fnc_throwWeapon.sqf index aacc1c7591..5a2938ed07 100644 --- a/addons/hitreactions/functions/fnc_throwWeapon.sqf +++ b/addons/hitreactions/functions/fnc_throwWeapon.sqf @@ -1,7 +1,8 @@ #include "script_component.hpp" /* * Author: commy2 - * Makes the unit throw their currently selected weapon. Unit must be local. + * Makes the unit throw their currently selected weapon. + * Unit must be local and not inside a vehicle or attached to another object. * * Arguments: * 0: unit @@ -20,7 +21,7 @@ params ["_unit"]; private _weapon = currentWeapon _unit; -if (_weapon isEqualTo "") exitWith {objNull}; +if (!isNull objectParent _unit || _weapon isEqualTo "") exitWith {objNull}; private _data = weaponsItems _unit select {_x select 0 == _weapon} select 0;