mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 17:20:26 +03:00
Add medic anim function with proper interrupt
Closes #1386 Vanilla commits applied:f99a3deced731b957e8eRemoved two unused files and a few variables made redundant by actionInProgress
This commit is contained in:
@@ -1,47 +1,26 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit"];
|
||||
private ["_finished","_id","_unit"];
|
||||
_unit = (_this select 3) select 0;
|
||||
|
||||
player removeMagazine "ItemMorphine";
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
player removeMagazine "ItemMorphine";
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
} else {
|
||||
uiSleep 3;
|
||||
_finished = true;
|
||||
};
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
} else {
|
||||
@@ -55,7 +34,6 @@ if ((_unit == player) or (vehicle player != player)) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
} else {
|
||||
player addMagazine "ItemMorphine";
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user