diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 4793b2d013..f352e253d3 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -66,8 +66,8 @@ if (_spallPower < 2) exitWith { TRACE_1("lowImpulse",_ammo); }; -private _lastVelocityUnit = vectorNormalized _lastVelocity; -private _deltaStep = _lastVelocityUnit vectorMultiply 0.05; +private _lastVelocityNorm = vectorNormalized _lastVelocity; +private _deltaStep = _lastVelocityNorm vectorMultiply 0.05; if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWith { TRACE_2("terrainIntersect",_lastPosASL,_deltaStep); @@ -75,17 +75,17 @@ if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWit #ifdef DEBUG_MODE_DRAW if GVAR(dbgSphere) then { - [_lastPosASL vectorAdd _lastVelocityUnit, "orange"] call FUNC(dev_sphereDraw); + [_lastPosASL vectorAdd _lastVelocityNorm, "orange"] call FUNC(dev_sphereDraw); [_lastPosASL, "yellow"] call FUNC(dev_sphereDraw); }; #endif /* * Improve performance of finding otherside of object on shallow angle - * impacts. 120 degrees due to 90 degree offset with _lastVelocityUnit into object. + * impacts. 120 degrees due to 90 degree offset with _lastVelocityNorm into object. */ private _spallPosASL = _lastPosASL vectorAdd _deltaStep; -if (120 > acos (_lastVelocityUnit vectorDotProduct _surfaceNorm)) then { +if (120 > acos (_lastVelocityNorm vectorDotProduct _surfaceNorm)) then { _spallPosASL = _spallPosASL vectorAdd (_deltaStep vectorMultiply 5); }; private _insideObject = true; @@ -128,8 +128,8 @@ private _spallSpawner = createVehicle [ 0, "CAN_COLLIDE" ]; -_spallSpawner setVectorDirandUp [_lastVelocityUnit, _vectorUp]; -_spallSpawner setVelocity (_lastVelocityUnit vectorMultiply (_velocityChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF)); +_spallSpawner setVectorDirandUp [_lastVelocityNorm, _vectorUp]; +_spallSpawner setVelocity (_lastVelocityNorm vectorMultiply (_velocityChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF)); _spallSpawner setShotParents _shotParents; #ifdef DEBUG_MODE_FULL diff --git a/addons/frag/functions/fnc_shouldFrag.sqf b/addons/frag/functions/fnc_shouldFrag.sqf index 3af9de5463..0ce6509b49 100644 --- a/addons/frag/functions/fnc_shouldFrag.sqf +++ b/addons/frag/functions/fnc_shouldFrag.sqf @@ -1,8 +1,7 @@ #include "..\script_component.hpp" /* * Author: Lambda.Tiger - * This function checks whether an ammunition type should cause fragmentation - * and whether any submunitions exist. + * This function checks whether an ammunition type should create fragments. * * Arguments: * 0: Type of ammo to check @@ -31,8 +30,12 @@ private _explosive = getNumber (_ammoConfig >> "explosive"); private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); -if (_skip == 1 || (_force == 0 && {_explosive < 0.5 || {_indirectHit < 3 - || {_indirectRange < 5 && _indirectHit < _indirectRange}}})) then { +if (_skip == 1 || + (_force == 0 && + {_explosive < 0.5 || + {_indirectHit < 3 || + {_indirectRange < 5 && + _indirectHit < _indirectRange}}})) then { TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit); _shouldFrag = false; }; diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 92591eda69..2f3f9068dc 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -45,4 +45,4 @@ #define ACE_FRAG_SPALL_HOLDOFF 0.25 #define ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF 0.5 // sqrt(2)/50 -#define ACE_FRAG_ROUND_COEF 0.02828427 \ No newline at end of file +#define ACE_FRAG_ROUND_COEF 0.02828427