Add check to prevent submarine sink into the ground

This commit is contained in:
AirwavesMan
2021-03-12 11:12:31 +01:00
parent 6d91cea790
commit c4118463dc
3 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
local _vehicle = _this select 0;
local _unit = _this select 2;
local _driver = driver _vehicle;
if (!(isNull _driver) && {_driver != _unit}) exitwith {};
while {_vehicle isKindOf "Submarine_DZE_base"} do {
local _pos = getposATL _vehicle;
if (((_vehicle animationphase "dive") > 0.5) && {(_pos select 2) < 10}) then {
_vehicle animate ["dive", 0];
};
uisleep 1;
};