From 141f10c415838a584bde1fcf72a090abb1fd816a Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Mon, 2 Dec 2013 09:54:52 -0600 Subject: [PATCH] fixed #826 --- SQF/dayz_code/medical/bandage.sqf | 43 +++++++++++++++++---------- SQF/dayz_code/medical/morphine.sqf | 6 ++++ SQF/dayz_code/medical/painkiller.sqf | 5 ++++ SQF/dayz_code/medical/transfusion.sqf | 10 ++++--- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/SQF/dayz_code/medical/bandage.sqf b/SQF/dayz_code/medical/bandage.sqf index bc4a811fd..277b39df7 100644 --- a/SQF/dayz_code/medical/bandage.sqf +++ b/SQF/dayz_code/medical/bandage.sqf @@ -7,13 +7,14 @@ player removeMagazine "ItemBandage"; call fnc_usec_medic_removeActions; r_action = false; -[1,1] call dayz_HungerThirst; if (vehicle player == player) then { //not in a vehicle player playActionNow "Medic"; }; +[1,1] call dayz_HungerThirst; + r_interrupt = false; _animState = animationState player; r_doLoop = true; @@ -38,26 +39,36 @@ while {r_doLoop} do { r_doLoop = false; if (_finished) then { - //["usecBandage",[_unit,player]] call broadcastRpcCallAll; - usecBandage = [_unit,player]; - publicVariable "usecBandage"; - - if (_unit == player) then { - //Self Healing - _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; - dayz_sourceBleeding = objNull; - } else { - //PVDZE_plr_HumanityChange = [player,20]; - [player,20] call player_humanityChange; - }; - {_unit setVariable[_x,false,true];} forEach USEC_woundHit; - _unit setVariable ["USEC_injured",false,true]; + _num_removed = ([player,"ItemBandage"] call BIS_fnc_invRemove); + if(_num_removed == 1) then { + + if (vehicle player != player) then { + _display = findDisplay 106; + _display closeDisplay 0; + }; + + //["usecBandage",[_unit,player]] call broadcastRpcCallAll; + usecBandage = [_unit,player]; + publicVariable "usecBandage"; + + if (_unit == player) then { + //Self Healing + _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; + dayz_sourceBleeding = objNull; + } else { + //PVDZE_plr_HumanityChange = [player,20]; + [player,20] call player_humanityChange; + }; + + {_unit setVariable[_x,false,true];} forEach USEC_woundHit; + _unit setVariable ["USEC_injured",false,true]; + + }; } else { r_interrupt = false; if (vehicle player == player) then { [objNull, player, rSwitchMove,""] call RE; player playActionNow "stop"; }; - player addMagazine "ItemBandage"; }; \ No newline at end of file diff --git a/SQF/dayz_code/medical/morphine.sqf b/SQF/dayz_code/medical/morphine.sqf index 914558348..a63848a13 100644 --- a/SQF/dayz_code/medical/morphine.sqf +++ b/SQF/dayz_code/medical/morphine.sqf @@ -38,6 +38,12 @@ r_doLoop = false; if (_finished) then { _num_removed = ([player,"ItemMorphine"] call BIS_fnc_invRemove); if(_num_removed == 1) then { + + if (vehicle player != player) then { + _display = findDisplay 106; + _display closeDisplay 0; + }; + if (_unit == player) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; diff --git a/SQF/dayz_code/medical/painkiller.sqf b/SQF/dayz_code/medical/painkiller.sqf index aa9cb33be..45cdae866 100644 --- a/SQF/dayz_code/medical/painkiller.sqf +++ b/SQF/dayz_code/medical/painkiller.sqf @@ -11,6 +11,11 @@ r_action = false; _num_removed = ([player,"ItemPainkiller"] call BIS_fnc_invRemove); if(_num_removed == 1) then { + if (vehicle player != player) then { + _display = findDisplay 106; + _display closeDisplay 0; + }; + _unit setVariable ["USEC_inPain", false, true]; if (vehicle player == player) then { diff --git a/SQF/dayz_code/medical/transfusion.sqf b/SQF/dayz_code/medical/transfusion.sqf index 66f82dc71..1be704fe5 100644 --- a/SQF/dayz_code/medical/transfusion.sqf +++ b/SQF/dayz_code/medical/transfusion.sqf @@ -10,11 +10,13 @@ _lastused = _unit getVariable ["LastTransfusion", time]; call fnc_usec_medic_removeActions; r_action = false; + +// not possible to transfuse while in a vehicle +if (vehicle player != player) exitWith { }; + +player playActionNow "Medic"; + [1,1] call dayz_HungerThirst; -if (vehicle player == player) then { - //not in a vehicle - player playActionNow "Medic"; -}; r_interrupt = false; _animState = animationState player;