Replaced a magic number

This commit is contained in:
lambdatiger 2024-01-15 01:18:47 -06:00
parent 97547700d2
commit 5273b002f9
2 changed files with 7 additions and 6 deletions

View File

@ -58,9 +58,8 @@ private _dV = vectorMagnitude _lVel - vectorMagnitude _vel;
* of sqrt(2)/50 * round caliber * srqt(change in speed). The second term is
* explosive * indirect hit, for any explosive contribution
*/
private _spallPower = (0.02828 * _caliber * sqrt _dV + _explosive * _indirectHit) * GVAR(spallIntensity);
private _spallPower = (ACE_FRAG_ROUND_COEF * _caliber * sqrt _dV + _explosive * _indirectHit) * GVAR(spallIntensity);
TRACE_3("found speed",_dV,_caliber,_spallPower);
TRACE_3("energy",0.02828*_caliber*sqrt(_dV),_explosive*_indirectHit,0.02828*_caliber*sqrt(_dV)+_explosive*_indirectHit);
if (_spallPower < 2) exitWith {
@ -123,7 +122,7 @@ private _spawnSize = switch (true) do
default { "_spall_huge" };
};
/*private _spallSpawner = createVehicle [
private _spallSpawner = createVehicle [
"ace_frag_" + _material + _spawnSize,
ASLToATL _spallPos,
[],
@ -132,7 +131,7 @@ private _spawnSize = switch (true) do
];
_spallSpawner setVectorDirandUp [_lVelUnit, _vUp];
_spallSpawner setVelocity (_lVelUnit vectorMultiply (_dV/2));
_spallSpawner setShotParents _shotParents;*/
_spallSpawner setShotParents _shotParents;
#ifdef DEBUG_MODE_FULL
systemChat ("bSpd: " + str speed _spallSpawner + ", frag: " + _fragSpawnType + ", dm: " + str _spallPower);

View File

@ -3,8 +3,8 @@
#include "\z\ace\addons\main\script_mod.hpp"
// #define LOG_FRAG_INFO
// #define DEBUG_MODE_FULL
// #define DEBUG_MODE_DRAW
#define DEBUG_MODE_FULL
#define DEBUG_MODE_DRAW
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
@ -25,6 +25,8 @@
#define ACE_FRAG_COUNT_MAX 50
#define ACE_FRAG_HITPOINTS ["spine1","spine2","spine3","head","leftarm","leftarmroll","leftforearm","rightarm","rightarmroll","rightforearm","pelvis","leftupleg","leftuplegroll","leftlegroll","leftfoot","rightupleg","rightuplegroll","rightleg","rightlegroll","rightfoot"]
#define ACE_FRAG_HITPOINTS_WEIGHTS
// sqrt(2)/50
#define ACE_FRAG_ROUND_COEF 0.02828427
#ifndef GLUE
#define GLUE(g1,g2) g1##g2