From 641dee39bd20f3027e3a9af11c92d33695ea261f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 7 Apr 2019 07:22:25 -0500 Subject: [PATCH] Fix trivial bugs (#6922) --- addons/interaction/functions/fnc_canPassMagazine.sqf | 1 + addons/medical_engine/script_component.hpp | 6 +++--- addons/overheating/functions/fnc_overheat.sqf | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/interaction/functions/fnc_canPassMagazine.sqf b/addons/interaction/functions/fnc_canPassMagazine.sqf index 82788fc24e..5cc1ed96e2 100644 --- a/addons/interaction/functions/fnc_canPassMagazine.sqf +++ b/addons/interaction/functions/fnc_canPassMagazine.sqf @@ -19,6 +19,7 @@ params ["_player", "_target", "_weapon"]; if (!GVAR(enableMagazinePassing)) exitWith {false}; +if (_weapon isEqualTo "") exitWith {false}; if (((vehicle _target) != _target) && {(vehicle _target) != (vehicle _player)}) exitWith {false}; private _compatibleMags = [_weapon] call CBA_fnc_compatibleMagazines; diff --git a/addons/medical_engine/script_component.hpp b/addons/medical_engine/script_component.hpp index 29d7344f4f..d45c30a024 100644 --- a/addons/medical_engine/script_component.hpp +++ b/addons/medical_engine/script_component.hpp @@ -4,7 +4,7 @@ // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE -//#define ENABLE_PERFORMANCE_COUNTERS +// #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_ENGINE #define DEBUG_MODE_FULL @@ -19,11 +19,11 @@ #include "\z\ace\addons\medical_engine\script_macros_config.hpp" #define PRELOAD_CLASS(class) \ - diag_log format["Starting preload for ""%1""",class];\ + INFO_1("Starting preload for (%1)",class);\ [{\ 1 preloadObject _this;\ }, {\ - diag_log format ["Preload done for ""%1""",_this];\ + INFO_1("Preload done for (%1)",_this);\ }, class] call CBA_fnc_waitUntilAndExecute #define PRIORITY_HEAD 3 diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index cff8807003..f1eb7b16c0 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -33,12 +33,12 @@ if (isNil "_energyIncrement") then { // If the bullet mass is not configured, estimate it _bulletMass = 3.4334 + 0.5171 * (getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit") + getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber")); }; - + // Projectile motion is roughly equal to Barrel heat // Ref: https://en.wikipedia.org/wiki/Physics_of_firearms // Muzzle Engergy = 1/2 * m * v^2 = (1/2 * 0.001 g/kg * bulletMass (grams) * v^2) // Multiple by 3 becase we only calc every 3rd bullet: (3 * 1/2 * 0.001) = 0.0015 - private _energyIncrement = 0.0015 * _bulletMass * (vectorMagnitudeSqr velocity _projectile); + _energyIncrement = 0.0015 * _bulletMass * (vectorMagnitudeSqr velocity _projectile); GVAR(cacheAmmoData) setVariable [_ammo, _energyIncrement]; };