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

Add Posibility to Change Backblast Values in Magazine Config and Add Caching for Backblast #1832

Closed
wants to merge 14 commits into from
Closed

Conversation

jokoho48
Copy link
Member

See #1829
and for Performance Improvement

@jokoho48 jokoho48 changed the title Add Posibility to Change Backblast Values in Magazine Config Add Posibility to Change Backblast Values in Magazine Config and Add Caching for Backblast Jul 10, 2015
@nicolasbadano nicolasbadano added the kind/enhancement Release Notes: **IMPROVED:** label Jul 13, 2015
@nicolasbadano nicolasbadano added this to the 3.2.0 milestone Jul 13, 2015
* None
*/

if (missionNameSpace getVariable [(QGVAR(Damage) + _this select 1),(([_this select 1,_this select 5] call DFUNC(cacheOverPressureVales)) select 2)]) then {
Copy link
Contributor

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 {
   ...
};

@ViperMaul
Copy link
Contributor

Status?

@jokoho48
Copy link
Member Author

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);
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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

@MikeMatrix
Copy link
Contributor

From looking at the code, apart from those minor comment changes, it looks good to me 👍

@jokoho48
Copy link
Member Author

ok fixed Done

@thojkooi thojkooi mentioned this pull request Sep 9, 2015
@thojkooi
Copy link
Contributor

#2385

@thojkooi thojkooi closed this Sep 10, 2015
@jokoho48 jokoho48 deleted the BackBlastEnhanced branch September 10, 2015 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants