-
Notifications
You must be signed in to change notification settings - Fork 735
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
removeVirtualItems - Remove case sensitivity #8844
Comments
Since I can't test I'll have to speculate, but would it be faster, if less RAM-efficient, to return a copy that's been created by adding only the wanted stuff, instead of deleting from the original array ? |
Oof, this is terrible code. Wouldn't it be enough to just lower case everything? _items = _items apply {toLower _x}; in L56.
_items = _items apply {configName (_x call CBA_fnc_getItemConfig)}; |
Should the case be random (I don't believe that), a much better way to write _fnc_remove is: private _fnc_remove = {_this select {!(toLower _x in _items)}}; (which requires the first example I gave to sanitize _items). Last resort would be inlining the filter via macro: #define FILTER(from, what) ((from) select {!(toLower _x in (what))}) and then (_x select 0) - _items -> FILTER(_x select 0, _items) |
This is exactly what is needed, thanks! |
Addressed in #9040. |
Is your enhancement related to a problem?
The ACE Arsenal doesn't return case sensitive naming for weapon attachments (which is another thing that could be remedied, but that's not the point of the issue).
If one wants to remove virtual items from the ACE Arsenal, they must give the case sensitive config name of the items to be removed.
E.g
[_this, ["optic_DMS"]] call ace_arsenal_fnc_removeVirtualItems
does not work, whereas[_this, ["optic_dms"]] call ace_arsenal_fnc_removeVirtualItems
does.This means the user has to look it up in the configs. Frankly it's not a big deal, but it would be nice if that could be avoided.
Solution you'd like:
I would like to see it case insensitive. It would be a quality of life improvement.
Proposed solution :
ACE3/addons/arsenal/functions/fnc_removeVirtualItems.sqf
Line 55 in f85ed21
This is what I have come up with as a working solution. However, it's noticeably slower for large arrays:
Testing with about 700 entries in the items parameter made the game freeze for an estimated time of 1-2s.
I'm hoping others can (help) implement this enhancement.
The text was updated successfully, but these errors were encountered: