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

AB - Fix ACE_twistDirection #2839

Merged
merged 1 commit into from
Nov 20, 2015
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ _weaponConfig = (configFile >> "CfgWeapons" >> _this);

_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
_twistDirection = 1;
_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection");
if !(_twistDirection in [-1, 0, 1]) then {
_twistDirection = 1;
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
Copy link
Member

Choose a reason for hiding this comment

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

getNumber returns 0 and if the value is not setyso I think it's safe to remove isNumber check in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-1, 0 and 1 are valid values for ACE_twistDirection
If no such config entry exists, it needs to be 1 not 0, so we need the isNumber check.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see now.

if !(_twistDirection in [-1, 0, 1]) then {
_twistDirection = 1;
};
};

_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
Expand Down