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

Add removeGlobalEventJIP #741

Merged
merged 3 commits into from
Sep 3, 2017
Merged

Add removeGlobalEventJIP #741

merged 3 commits into from
Sep 3, 2017

Conversation

PabstMirror
Copy link
Contributor

Idea is from something @Dystopian did in acemod/ACE3#5418
Adds a way to remove things from the globalEventJip queue.
Either immedietly or if passed an object it will remove the jipEvent if object is deleted.

remoteExec has something similar and it can be set to not run on jips if object is deleted.

Doesn't cause problems, but one issue is that setVar [x, nil] does not remove from allVariables
But it still stops the event from running.

@commy2
Copy link
Contributor

commy2 commented Aug 29, 2017

Doesn't cause problems, but one issue is that setVar [x, nil] does not remove from allVariables

-_-


params [["_jipID", "", [""]], ["_object", nil, [nil, objNull]]];

if ((isNil "_object") || {isNull _object}) then {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params [["_jipID", "", [""]], ["_object", objNull, [objNull]]];

if (isNull _object) then {

@Dystopian
Copy link
Contributor

call looks strange (to me):

_jipID = ["event"] call CBA_fnc_globalEventJIP;
[_jipID, _object] call CBA_fnc_removeGlobalEventJIP;

I mean we add the event and then remove it. Maybe function name should differ, e.g. unsetGlobalEventJIP.

@@ -6,7 +6,7 @@ Description:

Parameters:
_jipID - A unique ID from CBA_fnc_globalEventJIP. <STRING>
_object - Object, will remove jip EH when object is deleted. Or pass nil to ignore and remove immediately [optional] <OBJECT>or<NIL>
_object - Will remove jip EH when object is deleted or immediately if object is null [optional] <OBJECT>
Copy link
Contributor

@Dystopian Dystopian Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or immediately if object is null

or immediately if omitted

@commy2
Copy link
Contributor

commy2 commented Aug 30, 2017

execVM "\x\cba\addons\events\test_globalEventJIP.sqf"
10:13:13 [CBA] (events) Test OK: (CBA_fnc_globalEventJIP is defined) x\cba\addons\events\test_globalEventJIP.sqf:13
10:13:13 [CBA] (events) Test OK: (CBA_fnc_removeGlobalEventJIP is defined) x\cba\addons\events\test_globalEventJIP.sqf:14
10:13:13 [CBA] (events) Test OK: (cba_events_test_A == _expected) Verify EH ran x\cba\addons\events\test_globalEventJIP.sqf:23
10:13:13 [CBA] (events) Test OK: (not (isNil {cba_events_eventNamespaceJIP getVariable _ret})) x\cba\addons\events\test_globalEventJIP.sqf:24
10:13:13 [CBA] (events) Test OK: (isNil {cba_events_eventNamespaceJIP getVariable _ret}) x\cba\addons\events\test_globalEventJIP.sqf:28
10:13:13 [CBA] (events) Test OK: (isNil {cba_events_eventNamespaceJIP getVariable _ret}) x\cba\addons\events\test_globalEventJIP.sqf:33
10:13:13 [CBA] (events) Test OK: (not (isNil {cba_events_eventNamespaceJIP getVariable _ret})) x\cba\addons\events\test_globalEventJIP.sqf:39
10:13:15 [CBA] (events) Test OK: (isNull _dummyObject) x\cba\addons\events\test_globalEventJIP.sqf:42
10:13:15 [CBA] (events) Test OK: (isNil {cba_events_eventNamespaceJIP getVariable _ret}) x\cba\addons\events\test_globalEventJIP.sqf:43

@commy2 commy2 added this to the 3.4.1 milestone Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants