From 84ebc488abfb49d63f0f78b536e551d51febf6b8 Mon Sep 17 00:00:00 2001 From: icomrade Date: Thu, 9 Jan 2014 01:05:54 -0500 Subject: [PATCH] Fix medical actions in vehicles --- SQF/dayz_code/medical/bandage.sqf | 7 ++++++- SQF/dayz_code/medical/morphine.sqf | 7 ++++++- SQF/dayz_code/medical/painkiller.sqf | 2 +- SQF/dayz_code/medical/publicEH/animHealed.sqf | 2 +- SQF/dayz_code/medical/publicEH/medBandaged.sqf | 2 +- SQF/dayz_code/medical/publicEH/medMorphine.sqf | 2 +- SQF/dayz_code/medical/publicEH/medPainkiller.sqf | 2 +- SQF/dayz_code/medical/setup_functions_med.sqf | 2 +- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/SQF/dayz_code/medical/bandage.sqf b/SQF/dayz_code/medical/bandage.sqf index 488ba6b8f..68675ac61 100644 --- a/SQF/dayz_code/medical/bandage.sqf +++ b/SQF/dayz_code/medical/bandage.sqf @@ -35,6 +35,11 @@ while {r_doLoop} do { if (r_interrupt) then { r_doLoop = false; }; + if (vehicle player != player) then { + sleep 3; + r_doLoop = false; + _finished = true; + }; sleep 0.1; }; r_doLoop = false; @@ -53,7 +58,7 @@ if (_finished) then { usecBandage = [_unit,player]; publicVariable "usecBandage"; - if (_unit == player) then { + if ((_unit == player) or (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; dayz_sourceBleeding = objNull; diff --git a/SQF/dayz_code/medical/morphine.sqf b/SQF/dayz_code/medical/morphine.sqf index 052d16bd9..f21d254ab 100644 --- a/SQF/dayz_code/medical/morphine.sqf +++ b/SQF/dayz_code/medical/morphine.sqf @@ -34,6 +34,11 @@ while {r_doLoop} do { if (r_interrupt) then { r_doLoop = false; }; + if (vehicle player != player) then { + sleep 3; + r_doLoop = false; + _finished = true; + }; sleep 0.1; }; r_doLoop = false; @@ -47,7 +52,7 @@ if (_finished) then { _display closeDisplay 0; }; - if (_unit == player) then { + if ((_unit == player) or (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; } else { diff --git a/SQF/dayz_code/medical/painkiller.sqf b/SQF/dayz_code/medical/painkiller.sqf index d93c7eb35..a040425dc 100644 --- a/SQF/dayz_code/medical/painkiller.sqf +++ b/SQF/dayz_code/medical/painkiller.sqf @@ -24,7 +24,7 @@ if(_num_removed == 1) then { player playActionNow "Gear"; }; - if (_unit == player) then { + if ((_unit == player) or (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf"; } else { diff --git a/SQF/dayz_code/medical/publicEH/animHealed.sqf b/SQF/dayz_code/medical/publicEH/animHealed.sqf index bfa7b530d..7513b5564 100644 --- a/SQF/dayz_code/medical/publicEH/animHealed.sqf +++ b/SQF/dayz_code/medical/publicEH/animHealed.sqf @@ -4,7 +4,7 @@ private ["_unit"]; _unit = _this select 0; _unit switchMove "AmovPpneMstpSnonWnonDnon_healed"; -if (_unit == player) then { +if ((_unit == player) or (vehicle player != player)) then { r_player_unconscious = false; r_player_injured = false; }; \ No newline at end of file diff --git a/SQF/dayz_code/medical/publicEH/medBandaged.sqf b/SQF/dayz_code/medical/publicEH/medBandaged.sqf index ac9b07740..5a5f0ea03 100644 --- a/SQF/dayz_code/medical/publicEH/medBandaged.sqf +++ b/SQF/dayz_code/medical/publicEH/medBandaged.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if (_unit == player) then { +if ((_unit == player) or (vehicle player != player)) then { r_player_injured = false; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; r_player_handler = false; diff --git a/SQF/dayz_code/medical/publicEH/medMorphine.sqf b/SQF/dayz_code/medical/publicEH/medMorphine.sqf index 3cffdc96f..705c8e789 100644 --- a/SQF/dayz_code/medical/publicEH/medMorphine.sqf +++ b/SQF/dayz_code/medical/publicEH/medMorphine.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if (_unit == player) then { +if ((_unit == player) or (vehicle player != player)) then { r_fracture_legs = false; r_fracture_arms = false; _unit setHit["legs",0]; diff --git a/SQF/dayz_code/medical/publicEH/medPainkiller.sqf b/SQF/dayz_code/medical/publicEH/medPainkiller.sqf index 97b40bbf0..5ffa86036 100644 --- a/SQF/dayz_code/medical/publicEH/medPainkiller.sqf +++ b/SQF/dayz_code/medical/publicEH/medPainkiller.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if (_unit == player) then { +if ((_unit == player) or (vehicle player != player)) then { r_player_inpain = false; R3F_TIRED_Accumulator = 0; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index 43e385870..a170509c1 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -39,7 +39,7 @@ fnc_usec_damageUnconscious = { _unit = _this select 0; _damage = _this select 1; _inVehicle = (vehicle _unit != _unit); - if (_unit == player) then { + if ((_unit == player) or (vehicle player != player)) then { r_player_timeout = round((((random 2) max 0.1) * _damage) * 20); r_player_unconscious = true; player setVariable["medForceUpdate",true,true];