diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 75df469299..25f2909bd5 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -109,6 +109,7 @@ PREP(insertionSort); PREP(interpolateFromArray); PREP(inTransitionAnim); PREP(inWater); +PREP(isAlive); PREP(isArrested); PREP(isAutoWind); PREP(isAwake); diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf new file mode 100644 index 0000000000..1d5a99ac6b --- /dev/null +++ b/addons/common/functions/fnc_isAlive.sqf @@ -0,0 +1,14 @@ +/* + * Author: commy2 + * + * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true. + * + * Argument: + * 0: Any object (Object) + * + * Return value: + * The object exists and is alive (Bool). + */ +#include "script_component.hpp" + +!isNull (_this select 0) && {alive (_this select 0)}