function to check if an object is alive

This commit is contained in:
commy2 2015-03-10 23:35:05 +01:00
parent 70b946e6b5
commit cad5456010
2 changed files with 15 additions and 0 deletions

View File

@ -109,6 +109,7 @@ PREP(insertionSort);
PREP(interpolateFromArray);
PREP(inTransitionAnim);
PREP(inWater);
PREP(isAlive);
PREP(isArrested);
PREP(isAutoWind);
PREP(isAwake);

View File

@ -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)}