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

Versioning - Handle non-numbers in arrays #401

Merged
merged 1 commit into from
Jun 30, 2016
Merged
Changes from all 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
5 changes: 5 additions & 0 deletions addons/versioning/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ PREP(version_check);
FUNC(version_compare) = {
private ["_failed", "_c"];
params ["_value","_localValue"];

//Handle non-number arrays - eg. {"mod", {"1.0"}, "(true)"}
if ((!(_value isEqualTo [])) && {!(_value isEqualTypeAll 0)}) exitWith {true};
Copy link
Contributor

@commy2 commy2 Jun 29, 2016

Choose a reason for hiding this comment

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

inverted logic?

NVM, I get it.

if ((!(_localValue isEqualTo [])) && {!(_localValue isEqualTypeAll 0)}) exitWith {true};
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably log an error here.

Copy link
Contributor

Choose a reason for hiding this comment

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

And report an error. true -> false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will return true (true = failed) meaning it will report the dependency as being bad, which should be logged well enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Except it's not the dependency that is bad, it's the configuration that is incorrect.


_failed = false;
_c = count _localValue;

Expand Down