Wrapped BIS and CBA function calls in CALLSTACK.

Converted startTimer to CBA's perFrameEventHandler.
This commit is contained in:
Garth L-H de Wet 2015-01-13 12:13:43 +02:00
parent 43bac209d9
commit 6d8708618a
5 changed files with 7 additions and 10 deletions

View File

@ -18,7 +18,7 @@
*/
#include "\z\ace\explosives\script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
GVAR(pfeh_running) = false;
};
private ["_mag", "_setup", "_player"];

View File

@ -18,7 +18,7 @@
*/
#include "\z\ace\explosives\script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
GVAR(pfeh_running) = false;
};
if (!isNull (GVAR(Setup))) then {

View File

@ -23,6 +23,6 @@ private "_ex";
_ex=_this select 0;
_ex setDir (_this select 1);
if ((_this select 2) != 0) then {
[_ex, _this select 2, 0] call BIS_fnc_setPitchBank;
[_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank);
};
//_ex setVectorUp (surfaceNormal _pos);

View File

@ -58,7 +58,7 @@ GVAR(TweakedAngle) = 180;
if (ACE_Modifier == 0) then {
GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player);
};
}] call BIS_fnc_addStackedEventHandler;
}] call CALLSTACK(BIS_fnc_addStackedEventHandler);
[localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction",
localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(Interaction,showMouseHint);
_unit setVariable [QGVAR(Place), [_unit, "DefaultAction",

View File

@ -18,13 +18,10 @@
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
*/
#include "\z\ace\explosives\script_component.hpp"
_this spawn { // TODO: use scheduled delay execution
private ["_explosive", "_timer"];
[{
private ["_explosive"];
_explosive = _this select 0;
_timer = _this select 1;
sleep _timer;
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
};
};
},_this select 1, _this] call CALLSTACK(CBA_fnc_addPerFrameHandler);