white space, function headers and variable names

This commit is contained in:
lambdatiger 2024-02-14 20:07:19 -06:00
parent a976b28c69
commit 4ef23df3b3
3 changed files with 15 additions and 12 deletions

View File

@ -66,8 +66,8 @@ if (_spallPower < 2) exitWith {
TRACE_1("lowImpulse",_ammo); TRACE_1("lowImpulse",_ammo);
}; };
private _lastVelocityUnit = vectorNormalized _lastVelocity; private _lastVelocityNorm = vectorNormalized _lastVelocity;
private _deltaStep = _lastVelocityUnit vectorMultiply 0.05; private _deltaStep = _lastVelocityNorm vectorMultiply 0.05;
if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWith { if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWith {
TRACE_2("terrainIntersect",_lastPosASL,_deltaStep); TRACE_2("terrainIntersect",_lastPosASL,_deltaStep);
@ -75,17 +75,17 @@ if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWit
#ifdef DEBUG_MODE_DRAW #ifdef DEBUG_MODE_DRAW
if GVAR(dbgSphere) then { 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); [_lastPosASL, "yellow"] call FUNC(dev_sphereDraw);
}; };
#endif #endif
/* /*
* Improve performance of finding otherside of object on shallow angle * 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; 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); _spallPosASL = _spallPosASL vectorAdd (_deltaStep vectorMultiply 5);
}; };
private _insideObject = true; private _insideObject = true;
@ -128,8 +128,8 @@ private _spallSpawner = createVehicle [
0, 0,
"CAN_COLLIDE" "CAN_COLLIDE"
]; ];
_spallSpawner setVectorDirandUp [_lastVelocityUnit, _vectorUp]; _spallSpawner setVectorDirandUp [_lastVelocityNorm, _vectorUp];
_spallSpawner setVelocity (_lastVelocityUnit vectorMultiply (_velocityChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF)); _spallSpawner setVelocity (_lastVelocityNorm vectorMultiply (_velocityChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF));
_spallSpawner setShotParents _shotParents; _spallSpawner setShotParents _shotParents;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL

View File

@ -1,8 +1,7 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
* Author: Lambda.Tiger * Author: Lambda.Tiger
* This function checks whether an ammunition type should cause fragmentation * This function checks whether an ammunition type should create fragments.
* and whether any submunitions exist.
* *
* Arguments: * Arguments:
* 0: Type of ammo to check <STRING> * 0: Type of ammo to check <STRING>
@ -31,8 +30,12 @@ private _explosive = getNumber (_ammoConfig >> "explosive");
private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); private _indirectHit = getNumber (_ammoConfig >> "indirectHit");
private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange");
if (_skip == 1 || (_force == 0 && {_explosive < 0.5 || {_indirectHit < 3 if (_skip == 1 ||
|| {_indirectRange < 5 && _indirectHit < _indirectRange}}})) then { (_force == 0 &&
{_explosive < 0.5 ||
{_indirectHit < 3 ||
{_indirectRange < 5 &&
_indirectHit < _indirectRange}}})) then {
TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit); TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit);
_shouldFrag = false; _shouldFrag = false;
}; };