Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing loop (fnc_startFallbackLoop) with event mission #1696

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion addons/xeh/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class CfgFunctions {
PATHTO_FNC(supportMonitor);
PATHTO_FNC(compileEventHandlers);
PATHTO_FNC(compileFunction);
PATHTO_FNC(startFallbackLoop);

class preStart {
preStart = 1;
Expand Down
6 changes: 0 additions & 6 deletions addons/xeh/fnc_addClassEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ params [["_className", "", [""]], ["_eventName", "", [""]], ["_eventFunc", {}, [

private _config = configFile >> "CfgVehicles" >> _className;

// init fallback loop when executing on incompatible class for the first time
if (!GVAR(fallbackRunning) && {ISINCOMP(_className)}) then {
WARNING_1("One or more children of class %1 do not support Extended Event Handlers. Fall back to loop.",configName _config);
call CBA_fnc_startFallbackLoop;
};

// no such CfgVehicles class
if (!isClass _config) exitWith {false};

Expand Down
22 changes: 22 additions & 0 deletions addons/xeh/fnc_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ Author:
isNil {
XEH_LOG("PostInit started. " + PFORMAT_9("MISSIONINIT",missionName,missionVersion,worldName,isMultiplayer,isServer,isDedicated,CBA_isHeadlessClient,hasInterface,didJIP));

addMissionEventHandler ["EntityCreated", {
Jonastex marked this conversation as resolved.
Show resolved Hide resolved
params ["_entity"];
if ((!ISPROCESSED(_entity)) && (ISINCOMP(typeof _entity))) then {
_entity call CBA_fnc_initEvents;

if !(ISINITIALIZED(_entity)) then {
_entity call CBA_fnc_init;
};
};
}];

// init object incompatile XEH
{
if !(ISPROCESSED(_x)) then {
_x call CBA_fnc_initEvents;

if !(ISINITIALIZED(_x)) then {
_x call CBA_fnc_init;
};
};
} forEach (entities [(call (uiNamespace getVariable [QGVAR(incompatibleClasses), {[]}])), [], true, true]);
Jonastex marked this conversation as resolved.
Show resolved Hide resolved

// fix CBA_missionTime being -1 on (non-JIP) clients at mission start.
if (CBA_missionTime == -1) then {
CBA_missionTime = 0;
Expand Down
53 changes: 0 additions & 53 deletions addons/xeh/fnc_startFallbackLoop.sqf

This file was deleted.

Loading