mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Add check to prevent submarine sink into the ground
This commit is contained in:
13
SQF/dayz_code/compile/submarine_surface.sqf
Normal file
13
SQF/dayz_code/compile/submarine_surface.sqf
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user