-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add Caching to CBA_fnc_compatibleItems (Cleanup) #268
Conversation
from my side this is good to go 👍 but @robalo is the maintainer |
I have to catch up with things, don't wait for me. as long as you don't break the function... go for it. |
No, don't worry. This PR stores the cache on a dedicated namespace (location). |
@@ -1,10 +1,11 @@ | |||
/* | |||
Author: Karel Moricky | |||
Enhanced by Robalo | |||
adding Caching by joko // Jonas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Caching added by..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D ok will fix it
} foreach configproperties [_cfgWeapon >> "WeaponSlotsInfo","isclass _x"]; | ||
if (_typefilter == 0) then {_compatibleItems} else {[_compatibleItems, {_typefilter == getnumber(configfile>>"cfgweapons">>_x>>"itemInfo">>"type")}] call BIS_fnc_conditionalSelect}; | ||
nil | ||
} count configproperties [_cfgWeapon >> "WeaponSlotsInfo","isclass _x"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configProperties
, isClass
This has one drawback. createLocation crashes the game when no mission is there. Really minor, but we don't know all the ways this function could be used. |
Crashing the game doesn't sound minor to me. Please elaborate on "when no mission is there" and when/how the crash happens. (Potential for MP abuse?) |
For example when it's used in the main menu with |
Could leave first function untouched and add a 2nd that does caching. |
That might work, but again. This issue will most likely never happen. |
I was wrong about the crash in the main menu. Can't reproduce anymore. This PR should work. |
Fix the comments so we can merge this. |
Add Caching to CBA_fnc_compatibleItems (Cleanup)
Added fixes and test case to @jokoho48 's #261