From 35c82f2bceff49bfe5a5c391682c9b7911de366a Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 13 Jul 2019 18:55:33 -0600 Subject: [PATCH] final fixes, works over water now --- addons/ui_units/functions/fnc_onAltLoad.sqf | 4 +++- addons/ui_units/functions/fnc_onSpeedLoad.sqf | 2 +- addons/ui_units/functions/script_component.hpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/ui_units/functions/fnc_onAltLoad.sqf b/addons/ui_units/functions/fnc_onAltLoad.sqf index 0c5a75377a..bd388dd3c7 100644 --- a/addons/ui_units/functions/fnc_onAltLoad.sqf +++ b/addons/ui_units/functions/fnc_onAltLoad.sqf @@ -28,7 +28,9 @@ private _settingEH = ["CBA_SettingChanged", { }; _ctrl ctrlSetFade 1; _ctrl ctrlCommit 0; - private _altValue = (((getPosATL vehicle ACE_player) select 2) / GVAR(altRatio)); + private _vehicle = vehicle ACE_player; + private _rawAlt = ((getPosATL _vehicle) select 2) + (0 min (getTerrainHeightASL getPos _vehicle)); + private _altValue = _rawAlt / GVAR(altRatio); if (_altValue < 10) then { _altValue = _altValue toFixed 1; } else { diff --git a/addons/ui_units/functions/fnc_onSpeedLoad.sqf b/addons/ui_units/functions/fnc_onSpeedLoad.sqf index f2094bca23..95a148d7b3 100644 --- a/addons/ui_units/functions/fnc_onSpeedLoad.sqf +++ b/addons/ui_units/functions/fnc_onSpeedLoad.sqf @@ -28,5 +28,5 @@ private _settingEH = ["CBA_SettingChanged", { }; _ctrl ctrlSetFade 1; _ctrl ctrlCommit 0; - _speed ctrlSetText ((speed vehicle ACE_player / GVAR(speedRatio)) toFixed 0); + _speed ctrlSetText ((abs (speed vehicle ACE_player / GVAR(speedRatio))) toFixed 0); }, 0, [_ctrl, _speed, _settingEH]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/ui_units/functions/script_component.hpp b/addons/ui_units/functions/script_component.hpp index 20354e9e0f..b9c73dea0f 100644 --- a/addons/ui_units/functions/script_component.hpp +++ b/addons/ui_units/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\units\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\ui_units\script_component.hpp"