diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 5c2ad1e592..8230a4eb0b 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -183,6 +183,7 @@ PREP(unmuteUnit); PREP(useItem); PREP(useMagazine); PREP(waitAndExecute); +PREP(waveHeightAt); PREP(translateToWeaponSpace); PREP(translateToModelSpace); diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf new file mode 100644 index 0000000000..fbfe5fb241 --- /dev/null +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -0,0 +1,19 @@ +/* + * Author: jaynus + * + * Gets the wave height at a specific location. Uses a logic, so may be performance iffy + * + * Arguments: + * 0: Position ASL to get height at + * + * Return Value: + * Wave height in meters + * + */ + +if(isNil QGVAR(waveHeightLogic)) then { + GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; +}; +GVAR(waveHeightLogic) setPosASL (_this select 0); + +(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2)) \ No newline at end of file