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

Medical Treatment - Only create litter on empty container #9924

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

PabstMirror
Copy link
Contributor

Don't create pill boxes every time you take a single pill

@PabstMirror PabstMirror added the kind/change Release Notes: **CHANGED:** label Apr 4, 2024
@PabstMirror PabstMirror added this to the 3.17.1 milestone Apr 4, 2024
};
case (_x in _unitMagazines): {
private _magsStart = count magazines _unit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need count? isNotEqualTo should be enough no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(count a) == (count b);
0.0004638 ms

a isEqualTo b;
0.0014113 ms

Copy link
Contributor

Choose a reason for hiding this comment

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

Goddamn SQF just adding to the piling up pile of shit to test/remember for performance ... -.-

What about this ?

a isNotEqualTo [];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in this case a and b are both (possibly) large arrays, and it's only reason to use count here
array isEqualTo [] is still faster than count array == 0
I assume the first thing isEqualTo does is check the sizes are the same

@LinkIsGrim LinkIsGrim changed the title Medical Treatment - Only create litter when finishing a pill container Medical Treatment - Only create litter on empty container Apr 7, 2024
@LinkIsGrim LinkIsGrim merged commit 5ca3465 into master Apr 7, 2024
5 checks passed
@LinkIsGrim LinkIsGrim deleted the pillLitter branch April 7, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/change Release Notes: **CHANGED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants