From 53c0348a15b5979a635af73495c70e496f1eb035 Mon Sep 17 00:00:00 2001 From: Drofseh Date: Wed, 11 May 2022 16:21:05 -0700 Subject: [PATCH] Overheating - Add barrel mass config value (#8906) --- addons/overheating/functions/fnc_getWeaponData.sqf | 5 ++++- docs/wiki/framework/overheating-framework.md | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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 {