mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30: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,4 +1,4 @@
|
||||
private ["_vehicle","_started","_finished","_animState","_isMedic","_configVeh","_nameText","_towTruck","_inTow"];
|
||||
private ["_vehicle","_finished","_configVeh","_nameText","_towTruck","_inTow"];
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_96" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
@@ -14,7 +14,7 @@ _inTow = _towTruck getVariable ["DZEinTow", false];
|
||||
|
||||
if(_inTow) then {
|
||||
|
||||
// select vehicl in tow
|
||||
// select vehicle in tow
|
||||
_vehicle = _towTruck getVariable ["DZEvehicleInTow", objNull];
|
||||
|
||||
if(!(isNull _towTruck)) then {
|
||||
@@ -26,41 +26,7 @@ if(_inTow) then {
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = false;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started && !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user