mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +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,5 +1,5 @@
|
||||
//fixHatchet old file
|
||||
private ["_tool","_tape","_fixedItem","_config","_dName","_handle"];
|
||||
private ["_tool","_tape","_fixedItem","_config","_dName","_handle","_finished"];
|
||||
|
||||
_tool = _this;
|
||||
_config = configFile >> "CfgWeapons" >> _tool;
|
||||
@@ -12,21 +12,26 @@ _tape = "equip_duct_tape";
|
||||
//Handle
|
||||
_handle = "equip_lever";
|
||||
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
// Check if the player has the tape
|
||||
if ((_tape in magazines player) && (_handle in magazines player)) then {
|
||||
//Fix the tool
|
||||
player playActionNow "Medic";
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
uiSleep 6;
|
||||
player removeWeapon _tool;
|
||||
player removeMagazine _tape;
|
||||
player removeMagazine _handle;
|
||||
player addWeapon _fixedItem;
|
||||
format[localize "str_fixToolSuccess", _dName] call dayz_rollingMessages;
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished) exitWith {};
|
||||
|
||||
// Check again to make sure player didn't drop item
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
player removeWeapon _tool;
|
||||
player removeMagazine _tape;
|
||||
player removeMagazine _handle;
|
||||
player addWeapon _fixedItem;
|
||||
format[localize "str_fixToolSuccess", _dName] call dayz_rollingMessages;
|
||||
};
|
||||
} else { //If the player doesn't have the mats.
|
||||
if (!(_tape in magazines player)) then {
|
||||
if (!(_handle in magazines player)) then {
|
||||
@@ -37,4 +42,6 @@ if ((_tape in magazines player) && (_handle in magazines player)) then {
|
||||
} else {
|
||||
localize "str_fixtoolMissingHandle" call dayz_rollingMessages;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user