preInit defines and fix func name

This commit is contained in:
PabstMirror 2015-08-25 13:18:59 -05:00
parent 203c4d8a6c
commit 275f04d876
3 changed files with 12 additions and 10 deletions

View File

@ -18,7 +18,12 @@
(_x select 0) call (_x select 1);
} forEach GVAR(nextFrameBufferA);
//Swap double-buffer for execNextFrame:
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
GVAR(nextFrameBufferB) = [];
GVAR(nextFrameNo) = diag_frameno + 1;
//Handle the waitUntilAndExec array:
_deleted = 0;
{
_x params ["_condition", "_code", "_args"];
@ -28,11 +33,6 @@
_args call _code;
};
} forEach GVAR(waitUntilAndExecArray);
//Swap double-buffer:
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
GVAR(nextFrameBufferB) = [];
GVAR(nextFrameNo) = diag_frameno + 1;
}, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -194,6 +194,7 @@ PREP(unmuteUnit);
PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
PREP(waitUntilAndExecute);
PREP(waveHeightAt);
PREP(translateToWeaponSpace);
@ -297,11 +298,12 @@ PREP(_handleRequestAllSyncedEvents);
GVAR(syncedEvents) = HASH_CREATE;
//GVARS for execNextFrame and waitAndExec
//GVARS for execNextFrame and waitAndExec and waitUntilAndExecute
GVAR(waitAndExecArray) = [];
GVAR(nextFrameNo) = diag_frameno;
GVAR(nextFrameBufferA) = [];
GVAR(nextFrameBufferB) = [];
GVAR(waitUntilAndExecArray) = [];
// @TODO: Generic local-managed global-synced objects (createVehicleLocal)

View File

@ -1,22 +1,22 @@
/*
* Author: joko // Jonas
*
* Executes a code once with after the Condition is True, using a PFH
*
* Argument:
* 0: Condition <CODE>
* 1: Code to execute <CODE>
* 2: Parameters to run the code with <ARRAY,ANY,NIL>
*
* Return value:
* None
*
* Example:
* [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player], false] call ace_common_fnc_waitAndExecute
* [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitAndExecute
*
* Public: No
*/
#include "script_component.hpp"
TRACE_1("Adding",_this);
GVAR(waitUntilAndExecArray) pushBack _this;