From 63ee278e82a488a98c63712e371a1d110e11b628 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 22 Jan 2014 18:07:26 -0600 Subject: [PATCH] lifting fixes --- SQF/dayz_code/actions/player_heliLift.sqf | 6 ++---- SQF/dayz_code/compile/fn_selfActions.sqf | 5 +++++ SQF/dayz_code/init/variables.sqf | 3 +++ SQF/dayz_server/init/server_functions.sqf | 5 ++++- .../@DayZ_Epoch_Server/addons/dayz_server.pbo | Bin 1535975 -> 1536417 bytes 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/actions/player_heliLift.sqf b/SQF/dayz_code/actions/player_heliLift.sqf index 9ba217eba..fffedddc6 100644 --- a/SQF/dayz_code/actions/player_heliLift.sqf +++ b/SQF/dayz_code/actions/player_heliLift.sqf @@ -36,6 +36,7 @@ while {r_doLoop} do { _posL = getPos _liftHeli; _posC = getPos _vehicle; _height = (_posL select 2) - (_posC select 2); + /* if(_height < 20) then { if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then { _moved = true; @@ -43,6 +44,7 @@ while {r_doLoop} do { } else { _moved = true; }; + */ if (_isMedic) then { _started = true; @@ -74,10 +76,6 @@ if(_finished) then { r_doLoop = false; }; - if ((count (crew _vehicle)) > 0) then { - r_doLoop = false; - }; - if(typeName _attached == typeName false) then { r_doLoop = false; }; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index a8b9be7e1..1b34cebfa 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -274,6 +274,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu } forEach DZE_HeliAllowToTow; }; + //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow]; + if (_allowTow) then { _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15]; { @@ -291,6 +293,9 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; } forEach _liftHelis; }; + + //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget]; + _attached = _cursorTarget getVariable["attached",false]; if(_found and _allowTow and _canDo and !locked _cursorTarget and !_isPZombie and (typeName _attached != "OBJECT")) then { if (s_player_heli_lift < 0) then { diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index cd09fac3a..d23ae323e 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -493,6 +493,9 @@ if(isNil "DZE_MissionLootTable") then { if(isNil "DZE_LootSpawnTimer") then { DZE_LootSpawnTimer = 10; }; +if(isNil "DZE_HeliLift") then { + DZE_HeliLift = true; +}; // needed on server if(isNil "DZE_PlotPole") then { diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 185914b62..68de0562a 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -187,7 +187,10 @@ server_checkIfTowed = { _player = _this select 2; _attached = _vehicle getVariable["attached",false]; if ((typeName _attached == "OBJECT")) then { - _player action [ "eject", _vehicle)]; + _player action ["eject", _vehicle]; + detach _vehicle; + _vehicle setVariable["attached",false,true]; + _attached setVariable["hasAttached",false,true]; }; }; }; diff --git a/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo b/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo index d3c464abb91d42fdad2f7b91d9ecf964a5a669d5..87ce380f30f5121105bfc33d714ab122923b4d17 100644 GIT binary patch delta 562 zcmaEUKX&2c*bVPknJ?KqnEa7do9(R4gP`>VlRpZHO|EC-Zgytd?##w`%B(&$IomTW zB)>d0MZs2~nwN{SpeVB}u_RR?S}DFPH6t@QCsj#DDZU^lu`;y?#7ZnFNlea2O;L)q z2CB|XQ_ygUa*g*$&B^r1Oe@h;D9K380~^E%(+@P5GrlAvvsj@xH77N>M8N>0lM`$v zQ)|q>8T}QiA9--Nja&}N-zaVI%$bH#i?NX!4A+UsVqqKOUzAG zKr+NuLCN3A%hfqVNfX&o5NlJ56cUq5GV}9*-b~F(O|CCd(t+CwF_<$Y735L4DA>&i zKNaI~nNCSjDb#sL-a^rlkyz{q3rL`MID!6w=$d{}mQkdg#g-9>nShuXh*^M`6^Pk@ zm>q~YfS41Axqz4(h-A*fLIWSg@9NXh(YFw0WAQszx f+)n(Mkw}9^&BDzyU$&JTsJ(Ij@`2cWvIdy|8@EK2