Merge pull request #2771 from BaerMitUmlaut/inWater-deprecation

inWater -> isUnderwater
This commit is contained in:
Thomas Kooi 2015-11-20 22:28:43 +01:00
commit 4a19fcc5a5
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