From 5f2a7ac6334f81f948781e0cc9952441ea0e7a94 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 2 Mar 2016 13:07:01 -0600 Subject: [PATCH 1/4] Fix Versioning Condition Check --- addons/versioning/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/versioning/XEH_postInit.sqf b/addons/versioning/XEH_postInit.sqf index 8746369d6..5b9f8e9f5 100644 --- a/addons/versioning/XEH_postInit.sqf +++ b/addons/versioning/XEH_postInit.sqf @@ -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; From 2f0488d5874bba8c6c83f9fe8c0dbe8764a88471 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 2 Mar 2016 13:18:03 -0600 Subject: [PATCH 2/4] Handle Bad Conditionals --- addons/versioning/XEH_postInit.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/versioning/XEH_postInit.sqf b/addons/versioning/XEH_postInit.sqf index 5b9f8e9f5..50d48c768 100644 --- a/addons/versioning/XEH_postInit.sqf +++ b/addons/versioning/XEH_postInit.sqf @@ -27,6 +27,11 @@ if (!SLX_XEH_DisableLogging) then { _dependencyInfo = _x select 1; _class = (configFile >> "CfgPatches" >> (_dependencyInfo select 0)); private _dependencyIsPresent = call compile (_dependencyInfo select 2); + if ((isNil "_dependencyIsPresent") || {!(_dependencyIsPresent isEqualType false)}) then { + //https://dev.withsix.com/issues/74516 - The code could return non-bool, if "true" is converted to "1" durring binerization + WARNING("Versioning Conditional return is bad" + str _x); + _dependencyIsPresent = true; + }; 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; From 7d1aef77cc29391160616b304d44f62118bf8b51 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 4 Mar 2016 11:12:13 -0600 Subject: [PATCH 3/4] Cast string or number into string for compile --- addons/versioning/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/versioning/XEH_postInit.sqf b/addons/versioning/XEH_postInit.sqf index 50d48c768..1477ba91c 100644 --- a/addons/versioning/XEH_postInit.sqf +++ b/addons/versioning/XEH_postInit.sqf @@ -26,7 +26,7 @@ if (!SLX_XEH_DisableLogging) then { _mod = _x select 0; _dependencyInfo = _x select 1; _class = (configFile >> "CfgPatches" >> (_dependencyInfo select 0)); - private _dependencyIsPresent = call compile (_dependencyInfo select 2); + private _dependencyIsPresent = call compile format ["%1", (_dependencyInfo select 2)]; if ((isNil "_dependencyIsPresent") || {!(_dependencyIsPresent isEqualType false)}) then { //https://dev.withsix.com/issues/74516 - The code could return non-bool, if "true" is converted to "1" durring binerization WARNING("Versioning Conditional return is bad" + str _x); From e3a7ec9fe89846dc2c1f475a1cfe1d6a98ee99c9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 5 Mar 2016 11:32:33 -0600 Subject: [PATCH 4/4] Spelling --- addons/versioning/XEH_postInit.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/versioning/XEH_postInit.sqf b/addons/versioning/XEH_postInit.sqf index 1477ba91c..fb984461c 100644 --- a/addons/versioning/XEH_postInit.sqf +++ b/addons/versioning/XEH_postInit.sqf @@ -28,8 +28,8 @@ if (!SLX_XEH_DisableLogging) then { _class = (configFile >> "CfgPatches" >> (_dependencyInfo select 0)); private _dependencyIsPresent = call compile format ["%1", (_dependencyInfo select 2)]; if ((isNil "_dependencyIsPresent") || {!(_dependencyIsPresent isEqualType false)}) then { - //https://dev.withsix.com/issues/74516 - The code could return non-bool, if "true" is converted to "1" durring binerization - WARNING("Versioning Conditional return is bad" + str _x); + //https://dev.withsix.com/issues/74516 - The code could return non-bool, if "true" is converted to "1" durring binarization + WARNING("Versioning conditional return is bad" + str _x); _dependencyIsPresent = true; }; if (_dependencyIsPresent) then {