ACE3/addons/medical/functions/fnc_treatment_failure.sqf

50 lines
1.2 KiB
Plaintext
Raw Normal View History

/*
2015-02-28 19:46:36 +00:00
* Author: KoffeinFlummi, Glowbal
* Callback when the treatment fails
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: SelectionName <STRING>
* 3: Treatment classname <STRING>
* 4: Items available <ARRAY<STRING>>
*
* Return Value:
* nil
*
2015-02-28 19:46:36 +00:00
* Public: No
*/
#include "script_component.hpp"
2015-02-28 19:46:36 +00:00
private ["_caller", "_target","_selectionName","_className","_config","_callback"];
_args = _this select 0;
_caller = _args select 0;
_target = _args select 1;
_selectionName = _args select 2;
_className = _args select 3;
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
2015-02-28 19:46:36 +00:00
// @todo remove item?
2015-02-28 19:46:36 +00:00
// Record specific callback
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
2015-03-06 21:54:44 +00:00
if (GVAR(level) >= 2) then {
2015-02-28 19:46:36 +00:00
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
};
_callback = getText (_config >> "callbackFailure");
if (isNil _callback) then {
_callback = compile _callback;
} else {
_callback = missionNamespace getvariable _callback;
};
2015-02-28 19:46:36 +00:00
_args call _callback