-
Notifications
You must be signed in to change notification settings - Fork 739
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 Posibility to Change Backblast Values in Magazine Config and Add Caching for Backblast #1832
Conversation
* None | ||
*/ | ||
|
||
if (missionNameSpace getVariable [(QGVAR(Damage) + _this select 1),(([_this select 1,_this select 5] call DFUNC(cacheOverPressureVales)) select 2)]) then { |
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.
This should be divided. Because of how SQF works, the second term of the array is evaluated regardless if the value is already cached or not, so performance is wasted nonetheless.
Typically you need to do:
_varName = (QGVAR(Damage) + _this select 1);
if (isNil _varName) then {
...
} else {
...
};
Status? |
update code to params command update Comments
Need Review and hard testing because i rewrite the caching in complett |
private ["_var","_varName","_backblastAngle", "_backblastRange", "_backblastDamage"]; | ||
_varName = format [QGVAR(values%1%2%3), _weapon, _ammo, _magazine]; | ||
_var = if (isNil _varName) then { | ||
[_weapon,_magazine] call FUNC(cacheOverPressureVales); |
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.
cacheOverPressureVales
should be cacheOverPressureValues
// Bake Variable Name and Check if the Variable Exist else call the Cache Function | ||
_varName = format [QGVAR(values%1%2%3), _weapon, _ammo, _magazine]; | ||
_var = if (isNil _varName) then { | ||
([_weapon, _ammo, _magazine] call FUNC(cacheOverPressureVales)) select 2; |
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.
same here
_dangerZoneAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(angle)) / 2; | ||
_dangerZoneRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(range)); | ||
_dangerZoneDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(damage)); | ||
// Bake Variablen Name and Check if the Variable Exist else call the Cache Function |
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.
// Bake variable name and check if the variable exists, call the caching function otherwise
fix Input
From looking at the code, apart from those minor comment changes, it looks good to me 👍 |
ok fixed Done |
See #1829
and for Performance Improvement