diff --git a/addons/overheating/functions/fnc_getWeaponData.sqf b/addons/overheating/functions/fnc_getWeaponData.sqf index 2a9dc406b9..f2bd876a6c 100644 --- a/addons/overheating/functions/fnc_getWeaponData.sqf +++ b/addons/overheating/functions/fnc_getWeaponData.sqf @@ -81,7 +81,10 @@ private _reloadTime = getNumber (configfile >> "CfgWeapons" >> _weapon >> (_mode private _closedBolt = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(closedBolt)); -private _barrelMass = METAL_MASS_RATIO * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; +private _barrelMass = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(barrelMass)); +if (_barrelMass <= 0) then { + _barrelMass = METAL_MASS_RATIO * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; +}; // Cache the values _weaponData = [_dispersion, _slowdownFactor, _jamChance, _modes, _muzzle, _reloadTime, _closedBolt, _barrelMass]; diff --git a/docs/wiki/framework/overheating-framework.md b/docs/wiki/framework/overheating-framework.md index 5af0079af5..24f2255afe 100644 --- a/docs/wiki/framework/overheating-framework.md +++ b/docs/wiki/framework/overheating-framework.md @@ -53,10 +53,16 @@ class CfgWeapons { ```cpp class CfgWeapons { - class Rifle_Long_Base_F ; + class Rifle_Base_F; + class Rifle_Long_Base_F; + + class MyRifle: Rifle_Base_F { + ace_overheating_closedBolt = 1; // Closed bolt, can cook off from barrel heat. + ace_overheating_barrelMass = 1.5895; // Mass of the area heated by firing, not strictly just the barrel. Higher mass gives slower heat buildup and faster cooling. Default estimation is 55% of weapon weight in kg. + }; class MySniper: Rifle_Long_Base_F { - ace_overheating_closedBolt = 1; // Closed bolt, can cook off from barrel heat. + ace_overheating_closedBolt = 1; }; class MyMG: Rifle_Long_Base_F {