Skip to content

Commit

Permalink
Fix Versioning Condition Check
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Mar 2, 2016
1 parent 9303528 commit 5f2a7ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/versioning/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!SLX_XEH_DisableLogging) then {
_mod = _x select 0;
_dependencyInfo = _x select 1;
_class = (configFile >> "CfgPatches" >> (_dependencyInfo select 0));
missionNamespace setVariable ["_dependencyIsPresent", _dependencyInfo select 2];
private _dependencyIsPresent = call compile (_dependencyInfo select 2);
if (_dependencyIsPresent) then {
if !(isClass(_class)) then {
format["WARNING: %1 requires %2 (@%3) at version %4 (or higher). You have none.", _key, _dependencyInfo select 0, _mod, _dependencyInfo select 1] spawn _f;
Expand Down

2 comments on commit 5f2a7ac

@ViperMaul
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there is another method other than call compile, right?

@ViperMaul
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting to note that this change reverses a fix that was applied two years ago...
https://dev.withsix.com/projects/cba-a3/repository/revisions/b45a4772b36603574db9294e8bb8bb9b57e02d00/diff/addons/versioning/XEH_postInit.sqf

As you are aware this was a fix for the following:
https://dev.withsix.com/issues/74516
Also read the notes by @Killswitch00 therein https://dev.withsix.com/issues/74516#note-3

Perhaps the old fix was lacking however...
Is there a problem with doing the following?
missionNamespace setVariable [QGVAR(dependencyIsPresent), _dependencyInfo select 2,false];
The performance is faster than call compile and now the question: Is it safe enough.
In this case it may be safe enough.

Please sign in to comment.