From abeb5f9383444d766323a49677cab45e7664833d Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 12 Nov 2016 17:54:27 -0500 Subject: [PATCH] Remove vehicle actions when unconscious --- SQF/dayz_code/compile/fn_damageActions.sqf | 9 ++++++++- SQF/dayz_code/compile/fn_selfActions.sqf | 2 +- SQF/dayz_code/init/variables.sqf | 1 + SQF/dayz_code/medical/load/unLoad_act.sqf | 5 +++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index b7ce1528c..3d77a63f3 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -72,7 +72,7 @@ if (_inVehicle) then { }; //Check if patients _crew = crew _vehicle; - if (count _crew > 0) then { + if (count _crew > 0 && !r_player_unconscious) then { _unconscious_crew = []; { if (_x getVariable "NORRN_unconscious") then { @@ -100,6 +100,13 @@ if (_inVehicle) then { r_player_lastSeat = []; }; +if (r_player_unconscious) then { + call r_player_removeActions2; + r_player_lastVehicle = objNull; + r_player_lastSeat = []; + r_action_unload = false; +}; + //Lets make sure the player is looking at the target if (isPlayer cursorTarget) then { if (!r_drag_sqf && !r_action && !_inVehicle && !r_player_unconscious && (player distance _menClose < 3)) then { diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index bddb98ee0..9a2613eb5 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -124,7 +124,7 @@ if (!_canDoThis && s_player_Drinkfromhands >= 0) then { if (_inVehicle) then { DZE_myVehicle = _vehicle; - if (_vehicleOwnerID != "0" && !(_vehicle isKindOf "Bicycle")) then { + if (_vehicleOwnerID != "0" && !(_vehicle isKindOf "Bicycle") && _canDo) then { if (s_player_lockUnlockInside_ctrl < 0) then { _totalKeys = call epoch_tempKeys; _temp_keys = _totalKeys select 0; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index a00785f78..1758c5ac9 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -673,6 +673,7 @@ if (!isDedicated) then { dayz_salvageInProgress = false; lastSpawned = diag_tickTime; lastSepsis = 0; + NORRN_dropAction = -1; //uiNamespace setVariable ['DAYZ_GUI_display',displayNull]; //if (uiNamespace getVariable ['DZ_displayUI', 0] == 2) then { // dayzDebug = true; diff --git a/SQF/dayz_code/medical/load/unLoad_act.sqf b/SQF/dayz_code/medical/load/unLoad_act.sqf index ce5f440f0..868ea0e61 100644 --- a/SQF/dayz_code/medical/load/unLoad_act.sqf +++ b/SQF/dayz_code/medical/load/unLoad_act.sqf @@ -30,8 +30,9 @@ for [{ _loop = 0 },{ _loop < count _crewVcl },{ _loop = _loop + 1}] do _unit switchMove ""; _unit switchMove "ainjppnemstpsnonwrfldnon"; uiSleep 0.2; -// PVDZ_drg_Ralie = _unit; // not used -// publicVariable "PVDZ_drg_Ralie"; // not used + //Needed or else patient user input is not fully disabled after eject + PVDZ_drg_RaDrag = [_unit]; + publicVariable "PVDZ_drg_RaDrag"; }; uiSleep 0.1; };