Pass by reference for BI EHs (#6368)

This commit is contained in:
mharis001 2018-05-30 18:39:28 -04:00 committed by PabstMirror
parent f3f57c6a38
commit 232f986048
5 changed files with 6 additions and 6 deletions

View File

@ -29,7 +29,7 @@ if (_local) then {
if (_unit getVariable [QGVAR(handcuffAnimEHID), -1] != -1) exitWith {}; if (_unit getVariable [QGVAR(handcuffAnimEHID), -1] != -1) exitWith {};
// Otherwise, restart the AnimChanged EH in the new machine // Otherwise, restart the AnimChanged EH in the new machine
private _animChangedEHID = _unit addEventHandler ["AnimChanged", DFUNC(handleAnimChangedHandcuffed)]; private _animChangedEHID = _unit addEventHandler ["AnimChanged", {call FUNC(handleAnimChangedHandcuffed)}];
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID); TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
}; };
@ -40,7 +40,7 @@ if (_local) then {
if (_unit getVariable [QGVAR(surrenderAnimEHID), -1] != -1) exitWith {}; if (_unit getVariable [QGVAR(surrenderAnimEHID), -1] != -1) exitWith {};
// Otherwise, restart the AnimChanged EH in the new machine // Otherwise, restart the AnimChanged EH in the new machine
private _animChangedEHID = _unit addEventHandler ["AnimChanged", DFUNC(handleAnimChangedSurrendered)]; private _animChangedEHID = _unit addEventHandler ["AnimChanged", {call FUNC(handleAnimChangedSurrendered)}];
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID); TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
}; };

View File

@ -73,7 +73,7 @@ if (_state) then {
TRACE_1("removing animChanged EH",_animChangedEHID); TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit removeEventHandler ["AnimChanged", _animChangedEHID];
}; };
_animChangedEHID = _unit addEventHandler ["AnimChanged", DFUNC(handleAnimChangedHandcuffed)]; _animChangedEHID = _unit addEventHandler ["AnimChanged", {call FUNC(handleAnimChangedHandcuffed)}];
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID); TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];

View File

@ -64,7 +64,7 @@ if (_state) then {
TRACE_1("removing animChanged EH",_animChangedEHID); TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit removeEventHandler ["AnimChanged", _animChangedEHID];
}; };
_animChangedEHID = _unit addEventHandler ["AnimChanged", DFUNC(handleAnimChangedSurrendered)]; _animChangedEHID = _unit addEventHandler ["AnimChanged", {call FUNC(handleAnimChangedSurrendered)}];
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
}; };
}, [_unit], 0.01] call CBA_fnc_waitAndExecute; }, [_unit], 0.01] call CBA_fnc_waitAndExecute;

View File

@ -50,7 +50,7 @@
GVAR(currentAircraftNamespace) = true call CBA_fnc_createNamespace; GVAR(currentAircraftNamespace) = true call CBA_fnc_createNamespace;
publicVariable QGVAR(currentAircraftNamespace); publicVariable QGVAR(currentAircraftNamespace);
addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleDisconnect)]; addMissionEventHandler ["HandleDisconnect", {call FUNC(handleDisconnect)}];
}; };
GVAR(searchDistanceSqr) = GVAR(searchDistance) ^ 2; GVAR(searchDistanceSqr) = GVAR(searchDistance) ^ 2;

View File

@ -1,7 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
if (isServer) then { if (isServer) then {
addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleDisconnect)]; addMissionEventHandler ["HandleDisconnect", {call FUNC(handleDisconnect)}];
}; };
[QGVAR(initSource), LINKFUNC(initSource)] call CBA_fnc_addEventHandler; [QGVAR(initSource), LINKFUNC(initSource)] call CBA_fnc_addEventHandler;