forked from acemod/ACE3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfnc_treatmentFailure.sqf
More file actions
56 lines (46 loc) · 1.63 KB
/
fnc_treatmentFailure.sqf
File metadata and controls
56 lines (46 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, Glowbal, mharis001
* Handles treatment process failure.
*
* Arguments:
* 0: Arguments <ARRAY>
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* 2: Body Part <STRING>
* 3: Treatment <STRING>
* 4: Item User <OBJECT>
* 5: Used Item <STRING>
*
* Return Value:
* None
*
* Public: No
*/
params ["_args"];
_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem"];
// Return used item to user (if used)
if (!isNull _itemUser) then {
if (isClass (configFile >> "CfgMagazines" >> _usedItem)) then {
[_itemUser, _usedItem, 1] call EFUNC(common,adjustMagazineAmmo);
} else {
[_itemUser, _usedItem] call EFUNC(common,addToInventory);
};
};
// Switch medic to end animation immediately
private _endInAnim = _medic getVariable QGVAR(endInAnim);
if (!isNil "_endInAnim") then {
if (animationState _medic != _endInAnim) then {
[_medic, _endInAnim, 2] call EFUNC(common,doAnimation);
};
_medic setVariable [QGVAR(endInAnim), nil];
};
// Reset medic animation speed coefficient
[QEGVAR(common,setAnimSpeedCoef), [_medic, 1]] call CBA_fnc_globalEvent;
if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then {
EGVAR(advanced_fatigue,setAnimExclusions) deleteAt (EGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ADDON));
};
// Call treatment specific failure callback
GET_FUNCTION(_callbackFailure,configFile >> QGVAR(actions) >> _classname >> "callbackFailure");
_args call _callbackFailure;
["ace_treatmentFailed", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent;