2015-07-03 21:14:23 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi, Glowbal
|
|
|
|
* Callback when the repair is completed
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The engineer <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
|
|
|
* 2: SelectionName <STRING>
|
|
|
|
* 3: Treatment classname <STRING>
|
|
|
|
* 4: Items available <ARRAY<STRING>>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* nil
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
params ["_args"];
|
|
|
|
_args params ["_caller", "_target","_selectionName","_className"];
|
|
|
|
TRACE_4("params",_caller,_target,_selectionName,_className);
|
|
|
|
|
|
|
|
private ["_config","_callback", "_weaponSelect"];
|
2015-07-03 21:14:23 +00:00
|
|
|
|
|
|
|
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
|
|
|
|
_caller removeWeapon "ACE_FakePrimaryWeapon";
|
|
|
|
};
|
|
|
|
if (vehicle _caller == _caller) then {
|
2015-08-14 18:49:51 +00:00
|
|
|
[_caller, _caller getvariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation);
|
2015-07-03 21:14:23 +00:00
|
|
|
};
|
|
|
|
_caller setvariable [QGVAR(repairPrevAnimCaller), nil];
|
|
|
|
|
2015-08-14 18:49:51 +00:00
|
|
|
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnrepair), ""]);
|
2015-07-03 21:14:23 +00:00
|
|
|
if (_weaponSelect != "") then {
|
|
|
|
_caller selectWeapon _weaponSelect;
|
|
|
|
} else {
|
|
|
|
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Record specific callback
|
|
|
|
_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className);
|
|
|
|
|
|
|
|
_callback = getText (_config >> "callbackSuccess");
|
|
|
|
if (isNil _callback) then {
|
|
|
|
_callback = compile _callback;
|
|
|
|
} else {
|
|
|
|
_callback = missionNamespace getvariable _callback;
|
|
|
|
};
|
|
|
|
_args call _callback;
|
|
|
|
|
|
|
|
// _args call FUNC(createLitter);
|