Fix trivial bugs (#6922)

This commit is contained in:
PabstMirror 2019-04-07 07:22:25 -05:00 committed by jonpas
parent d2172c5060
commit 641dee39bd
3 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -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

View File

@ -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];
};