mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +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:
@@ -11,8 +11,8 @@ dayz_actionInProgress = true;
|
||||
|
||||
private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
|
||||
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
|
||||
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
|
||||
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear"];
|
||||
"_sfx","_ownerID","_objectID","_objectUID","_dir","_weapons","_magazines","_backpacks","_object",
|
||||
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear","_finished"];
|
||||
|
||||
_cursorTarget = _this select 3;
|
||||
|
||||
@@ -98,24 +98,17 @@ if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_l
|
||||
|
||||
//Does object have a upgrade option.
|
||||
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
//play animation
|
||||
player playActionNow "Medic";
|
||||
_dis = 20;
|
||||
_sfx = "tentpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
//Double check player did not drop required parts
|
||||
if (!_finished or (isNull _cursorTarget) or ({!(_x in magazines player)} count _upgradeParts > 0)) exitWith {};
|
||||
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
|
||||
|
||||
//Upgrade
|
||||
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
|
||||
|
||||
if (_alreadyupgrading == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
|
||||
|
||||
_cursorTarget setVariable["alreadyupgrading",1,true];
|
||||
|
||||
uiSleep 0.03;
|
||||
|
||||
//Get location and direction of old item
|
||||
_dir = round getDir _cursorTarget;
|
||||
@@ -134,9 +127,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
_magazines = getMagazineCargo _cursorTarget;
|
||||
_backpacks = getBackpackCargo _cursorTarget;
|
||||
|
||||
//replay animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
//remove old tent
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
@@ -190,8 +180,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
_countr = _countr + 1;
|
||||
} count _objWpnTypes;
|
||||
|
||||
uiSleep 3;
|
||||
|
||||
//publish new tent
|
||||
if (DZE_permanentPlot) then {
|
||||
_object setVariable ["ownerPUID",dayz_playerUID,true];
|
||||
|
||||
Reference in New Issue
Block a user