Deprecated isWater

This commit is contained in:
BaerMitUmlaut 2015-10-19 23:28:50 +02:00
parent 98c6c37d9c
commit c227f05f8a
3 changed files with 36 additions and 16 deletions

View File

@ -115,6 +115,7 @@ PREP(isInBuilding);
PREP(isModLoaded);
PREP(isPlayer);
PREP(isTurnedOut);
PREP(isUnderwater);
PREP(letterToCode);
PREP(lightIntensityFromObject);
PREP(loadPerson);

View File

@ -1,29 +1,19 @@
/*
* Author: Glowbal
* Check if unit is underwater
* Check if unit's head is underwater
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* if unit is in the water (BOOLEAN)
* If unit's head is underwater <BOOL>
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params ["_unit"];
ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater");
private "_return";
_return = false;
if (surfaceIsWater getPosASL _unit) then {
private "_pos";
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
if (_pos select 2 < 0) then {
_return = true;
};
};
_return
_this call FUNC(isUnderwater)

View File

@ -0,0 +1,29 @@
/*
* Author: Glowbal
* Check if unit's head is underwater
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* If unit's head is underwater <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
private "_return";
_return = false;
if (surfaceIsWater getPosASL _unit) then {
private "_pos";
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
if (_pos select 2 < 0) then {
_return = true;
};
};
_return