From eef48da6bc5f954af377ca4f7cdd739d8bb2015d Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 10 Jan 2024 18:51:38 -0600 Subject: [PATCH] Converetd all stray tabs to spaces --- addons/frag/CfgAmmo.hpp | 14 +++---- addons/frag/XEH_postInit.sqf | 12 +++--- addons/frag/cfgAmmoBaseEH.hpp | 38 +++++++++---------- addons/frag/cfgAmmoFragSpawner.hpp | 34 ++++++++--------- addons/frag/cfgAmmoSpall.hpp | 2 +- addons/frag/functions/fnc_dev_addRound.sqf | 2 +- addons/frag/functions/fnc_dev_drawTrace.sqf | 4 +- .../frag/functions/fnc_dev_fragCalcDump.sqf | 6 +-- .../functions/fnc_dev_switchUnitHandle.sqf | 14 +++---- addons/frag/functions/fnc_dev_trackObj.sqf | 10 ++--- addons/frag/functions/fnc_doFrag.sqf | 9 ++--- addons/frag/functions/fnc_doFragRandom.sqf | 4 +- addons/frag/functions/fnc_doFragTargeted.sqf | 8 ++-- addons/frag/functions/fnc_doSpall.sqf | 25 ++++++------ addons/frag/functions/fnc_fired.sqf | 3 +- addons/frag/functions/fnc_getFragInfo.sqf | 12 +++--- addons/frag/functions/fnc_getMaterialInfo.sqf | 12 +++--- addons/frag/functions/fnc_shouldFrag.sqf | 2 +- addons/frag/initSettings.inc.sqf | 11 +++--- 19 files changed, 110 insertions(+), 112 deletions(-) diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 1088f39a08..911e18cb30 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -2,19 +2,19 @@ #define HD_MULT 5 #define BASE_DRAG_HD (BASE_DRAG * HD_MULT) #define ACE_FRAG_RM_EH class EventHandlers {\ - delete ADDON;\ + delete ADDON;\ } class CfgAmmo { class B_65x39_Caseless; - class GVAR(base): B_65x39_Caseless { + class GVAR(base): B_65x39_Caseless { ACE_damageType = "grenade"; // compatibility with medical_damage, shrapnel should produce grenade wounds timeToLive = 4; typicalSpeed = 800; maxSpeed = 1500; deflecting = 65; - ACE_FRAG_RM_EH; + ACE_FRAG_RM_EH; }; class GVAR(tiny): GVAR(base) { @@ -85,8 +85,8 @@ class CfgAmmo { caliber = 2.8; }; - #include "cfgAmmoBaseEH.hpp" - #include "cfgAmmoSpall.hpp" - #include "cfgAmmoFragParameters.hpp" - #include "cfgAmmoFragSpawner.hpp" + #include "cfgAmmoBaseEH.hpp" + #include "cfgAmmoSpall.hpp" + #include "cfgAmmoFragParameters.hpp" + #include "cfgAmmoFragSpawner.hpp" }; \ No newline at end of file diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 137db6c0d2..063060551b 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -5,7 +5,7 @@ [QGVAR(frag_eh), LINKFUNC(doFrag)] call CBA_fnc_addEventHandler; [QGVAR(spall_eh), LINKFUNC(doFragMomentum)] call CBA_fnc_addEventHandler; [] call FUNC(initBlackList); - [] call FUNC(initMaterialCache); + [] call FUNC(initMaterialCache); }; /*if (hasInterface) then { @@ -17,11 +17,11 @@ ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;*/ #ifdef DEBUG_MODE_DRAW - if (hasInterface && GVAR(debugOptions)) then { - private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; - missionNamespace setVariable [QGVAR(dev_drawPFEH), _h]; - ["unit", LINKFUNC(dev_switchUnitHandle), true] call CBA_fnc_addPlayerEventHandler; - [objNull, ace_player] call FUNC(dev_switchUnitHandle); + if (hasInterface && GVAR(debugOptions)) then { + private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; + missionNamespace setVariable [QGVAR(dev_drawPFEH), _h]; + ["unit", LINKFUNC(dev_switchUnitHandle), true] call CBA_fnc_addPlayerEventHandler; + [objNull, ace_player] call FUNC(dev_switchUnitHandle); }; #endif }] call CBA_fnc_addEventHandler; diff --git a/addons/frag/cfgAmmoBaseEH.hpp b/addons/frag/cfgAmmoBaseEH.hpp index 050a7d769d..b8a1596af6 100644 --- a/addons/frag/cfgAmmoBaseEH.hpp +++ b/addons/frag/cfgAmmoBaseEH.hpp @@ -1,85 +1,85 @@ #define ACE_FRAG_ADD_EH class EventHandlers {\ - class ADDON {\ - init = QUOTE(_this call FUNC(initRound););\ - };\ + class ADDON {\ + init = QUOTE(_this call FUNC(initRound););\ + };\ } class BombCore; class Bo_Mk82: BombCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; // We need this since autocannons generally inherit from BulletBase class BulletCore; class BulletBase: BulletCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class Grenade; class GrenadeHand: Grenade { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class GrenadeCore; class GrenadeBase: GrenadeCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class LaserBombCore; class ammo_Bomb_LaserGuidedBase: LaserBombCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class MissileCore; class MissileBase: MissileCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class RocketCore; class RocketBase: RocketCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class ArtilleryRocketCore: RocketCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class ShellCore; class ShellBase: ShellCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class ShotDeployCore; class ShotDeployBase: ShotDeployCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class ShotgunCore; class ShotgunBase: ShotgunCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class SubmunitionCore; class SubmunitionBase: SubmunitionCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class BoundingMineCore; class BoundingMineBase: BoundingMineCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class PipeBombCore; class PipeBombBase: PipeBombCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class DirectionalBombCore; class DirectionalBombBase: DirectionalBombCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; class MineCore; class MineBase: MineCore { - ACE_FRAG_ADD_EH; + ACE_FRAG_ADD_EH; }; \ No newline at end of file diff --git a/addons/frag/cfgAmmoFragSpawner.hpp b/addons/frag/cfgAmmoFragSpawner.hpp index be85d81be1..d7dc0be689 100644 --- a/addons/frag/cfgAmmoFragSpawner.hpp +++ b/addons/frag/cfgAmmoFragSpawner.hpp @@ -13,7 +13,7 @@ class GVAR(spawnbase) : B_65x39_Caseless { submunitionParentSpeedCoef = 1; triggerSpeedCoef[] = {0.75, 1.5}; triggerTime = 0; - ACE_FRAG_RM_EH; + ACE_FRAG_RM_EH; }; /********************* ***************************/ @@ -23,7 +23,7 @@ class GVAR(def_10) : GVAR(spawnbase) { class GVAR(def_10_lo) : GVAR(def_10) { submunitionConeAngle = 85; }; -class GVAR(def_10_mid) : GVAR(def_10) { +class GVAR(def_10_mid) : GVAR(def_10) { submunitionConeAngle = 85; triggerSpeedCoef[] = {-1.5, 1.5}; }; @@ -31,13 +31,13 @@ class GVAR(def_10_hi) : GVAR(def_10) { submunitionConeAngle = 80; triggerSpeedCoef[] = {-1.5, -0.75}; }; -class GVAR(def_10_top) : GVAR(def_10) { +class GVAR(def_10_top) : GVAR(def_10) { submunitionConeAngle = 60; triggerSpeedCoef[] = {-1.5, -0.75}; }; /********************* ***************************/ -class GVAR(def_15) : GVAR(spawnbase) { +class GVAR(def_15) : GVAR(spawnbase) { submunitionConeType[] = {"random", 15}; }; class GVAR(def_15_lo) : GVAR(def_15) { @@ -57,7 +57,7 @@ class GVAR(def_15_top) : GVAR(def_15) { }; /********************* ***************************/ -class GVAR(def_5) : GVAR(spawnbase) { +class GVAR(def_5) : GVAR(spawnbase) { submunitionConeType[] = {"random", 5}; }; class GVAR(def_5_lo) : GVAR(def_5) { @@ -76,8 +76,8 @@ class GVAR(def_5_top) : GVAR(def_5) { triggerSpeedCoef[] = {-1.5, -0.75}; }; -/********************* ***************************/ -class GVAR(def_tiny_15) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_tiny_15) : GVAR(spawnbase) { submunitionConeType[] = {"random", 15}; submunitionAmmo = QGVAR(tiny); }; @@ -97,8 +97,8 @@ class GVAR(def_tiny_15_top) : GVAR(def_tiny_15) { triggerSpeedCoef[] = {-1.5, -0.75}; }; -/********************* ***************************/ -class GVAR(def_tiny_10) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_tiny_10) : GVAR(spawnbase) { submunitionConeType[] = {"random", 10}; submunitionAmmo = QGVAR(tiny); }; @@ -118,8 +118,8 @@ class GVAR(def_tiny_10_top) : GVAR(def_tiny_10) { triggerSpeedCoef[] = {-1.5, -0.75}; }; -/********************* ***************************/ -class GVAR(def_tiny_5) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_tiny_5) : GVAR(spawnbase) { submunitionConeType[] = {"random", 5}; submunitionAmmo = QGVAR(tiny); }; @@ -138,8 +138,8 @@ class GVAR(def_tiny_5_top) : GVAR(def_tiny_5) { submunitionConeAngle = 60; triggerSpeedCoef[] = {-1.5, -0.75}; }; -/********************* ***************************/ -class GVAR(def_small_15) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_small_15) : GVAR(spawnbase) { submunitionConeType[] = {"random", 15}; submunitionAmmo = QGVAR(small); }; @@ -158,8 +158,8 @@ class GVAR(def_small_15_top) : GVAR(def_small_15) { submunitionConeAngle = 60; triggerSpeedCoef[] = {-1.15, -0.715}; }; -/********************* ***************************/ -class GVAR(def_small_10) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_small_10) : GVAR(spawnbase) { submunitionConeType[] = {"random", 10}; submunitionAmmo = QGVAR(small); }; @@ -178,8 +178,8 @@ class GVAR(def_small_10_top) : GVAR(def_small_10) { submunitionConeAngle = 60; triggerSpeedCoef[] = {-1.10, -0.710}; }; -/********************* ***************************/ -class GVAR(def_small_5) : GVAR(spawnbase) { +/********************* ***************************/ +class GVAR(def_small_5) : GVAR(spawnbase) { submunitionConeType[] = {"random", 5}; submunitionAmmo = QGVAR(small); }; diff --git a/addons/frag/cfgAmmoSpall.hpp b/addons/frag/cfgAmmoSpall.hpp index d6de86476a..3e51df4a15 100644 --- a/addons/frag/cfgAmmoSpall.hpp +++ b/addons/frag/cfgAmmoSpall.hpp @@ -10,7 +10,7 @@ class GVAR(spallBase) : B_65x39_Caseless { triggerSpeedCoef[] = {0.75,1.25}; deleteParentWhenTriggered = 1; submunitionParentSpeedCoef = 1; - ACE_FRAG_RM_EH; + ACE_FRAG_RM_EH; }; diff --git a/addons/frag/functions/fnc_dev_addRound.sqf b/addons/frag/functions/fnc_dev_addRound.sqf index 7ad5b05df3..483ac8cfae 100644 --- a/addons/frag/functions/fnc_dev_addRound.sqf +++ b/addons/frag/functions/fnc_dev_addRound.sqf @@ -27,7 +27,7 @@ params [ if (_sidePlayer) then { GVAR(dev_trackLines) set [getObjectID _proj, [1, [getposATL _proj], [0, 0, 1, 1]]]; -} else +} else { GVAR(dev_trackLines) set [getObjectID _proj, [1, [getposATL _proj], [1, 0, 0, 1]]]; }; diff --git a/addons/frag/functions/fnc_dev_drawTrace.sqf b/addons/frag/functions/fnc_dev_drawTrace.sqf index f561d0b513..72fd7cd452 100644 --- a/addons/frag/functions/fnc_dev_drawTrace.sqf +++ b/addons/frag/functions/fnc_dev_drawTrace.sqf @@ -23,7 +23,7 @@ private _deleteArr = []; { drawLine3D [_y#1#(_j-1), _y#1#_j, _y#2]; }; - }; + }; } forEach GVAR(dev_trackLines); if (GVAR(drawHitBox)) then { @@ -41,7 +41,7 @@ if (GVAR(drawHitBox)) then { { for "_i" from 1 to count _x -1 do { - drawLine3D [_obj modelToWorld (_pts#(_x#_i)), _obj modelToWorld (_pts#(_x#(_i-1))), _color]; + drawLine3D [_obj modelToWorld (_pts#(_x#_i)), _obj modelToWorld (_pts#(_x#(_i-1))), _color]; }; } forEach HB_DRAW_ARRS; diff --git a/addons/frag/functions/fnc_dev_fragCalcDump.sqf b/addons/frag/functions/fnc_dev_fragCalcDump.sqf index 40ce58accc..d95f622d47 100644 --- a/addons/frag/functions/fnc_dev_fragCalcDump.sqf +++ b/addons/frag/functions/fnc_dev_fragCalcDump.sqf @@ -6,7 +6,7 @@ * * Arguments: * 0: _dispAll - Display rounds that will never frag (power < 5). - * Default value false + * Default value false * 1: _minFrgPowRng - minimum range for sqrt power calculation * * Return Value: @@ -63,8 +63,8 @@ diag_log text "//****************** fragCalcDump Beg ******************//"; if (_gC == 0) then {_gC = 2440;}; private _fragCount = getNumber (configFile >> "cfgAmmo" >> _ammo >> QGVAR(fragCount)); if (_fragCount == 0) then {_fragCount = 200; _warn = true}; - - private _velocity = 0.8 * _gC * sqrt (_c /(_m + _c * _k)); + + private _velocity = 0.8 * _gC * sqrt (_c /(_m + _c * _k)); // number of shrapnel to send a direction private _count = ceil (random (sqrt (_m / 1000))); private _fragPowerSpeedRange = [0.5, 1] vectorMultiply _fragPower; diff --git a/addons/frag/functions/fnc_dev_switchUnitHandle.sqf b/addons/frag/functions/fnc_dev_switchUnitHandle.sqf index 0ed7a59798..6c05a13699 100644 --- a/addons/frag/functions/fnc_dev_switchUnitHandle.sqf +++ b/addons/frag/functions/fnc_dev_switchUnitHandle.sqf @@ -31,13 +31,13 @@ _aID = _cVic addAction [ "Reset Lines", FUNC(dev_clearTraces), - nil, // arguments - 1.5, // priority - true, // showWindow - false, // hideOnUse - "", // shortcut - "true", // condition - 8 + nil, // arguments + 1.5, // priority + true, // showWindow + false, // hideOnUse + "", // shortcut + "true", // condition + 8 ]; missionNamespace getVariable [QGVAR(dev_clearTraceAction), _aID]; \ No newline at end of file diff --git a/addons/frag/functions/fnc_dev_trackObj.sqf b/addons/frag/functions/fnc_dev_trackObj.sqf index c06fa763ae..0f45ad370d 100644 --- a/addons/frag/functions/fnc_dev_trackObj.sqf +++ b/addons/frag/functions/fnc_dev_trackObj.sqf @@ -17,9 +17,9 @@ * Public: No */ params [ - "_obj", - ["_color", "blue", ["blue"]], - ["_isProj", false, [false]] + "_obj", + ["_color", "blue", ["blue"]], + ["_isProj", false, [false]] ]; TRACE_4("devDraw",_this,_obj,_color,_isProj); /// track round on each frame @@ -33,7 +33,7 @@ private _colorArray = switch (toLower _color) do { case "red": {[0.8, 0, 0, 1]}; case "black": {[1, 1, 1, 1]}; case "white": {[0, 0, 0, 1]}; - default {[0, 0.8, 0.8, 1]}; + default {[0, 0.8, 0.8, 1]}; }; GVAR(dev_trackLines) set [getObjectID _obj, [1, [getposATL _obj], _colorArray]]; @@ -93,7 +93,7 @@ _obj addEventHandler [ ]; // Add deflected eventHandler -_proj addEventHandler [ +_obj addEventHandler [ "Deflected", { params ["_proj", "_posASL"]; diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index 8316ee268e..74bd5a1746 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -25,19 +25,19 @@ _args*/ params [ ["_proj", objNull, [objNull]], ["_posASL", [0,0,0], [[]], [3]], ["_vel", [0,0,0] , [[]], [3]], - ["_ammo", "", [""]], - ["_shotParents", [objNull, objNull], [[]]] + ["_ammo", "", [""]], + ["_shotParents", [objNull, objNull], [[]]] ]; private _shotParentVic = _shotParents#0; if (_shotParentVic getVariable [QGVAR(nextFragTime), -1] > CBA_missionTime) exitWith { - TRACE_1("vehicleTimeExit",_shotParentVic); + TRACE_1("vehicleTimeExit",_shotParentVic); }; _shotParentVic setVariable [QGVAR(nextFragTime), CBA_missionTime + ACE_FRAG_HOLDOFF_VEHICLE]; private _timeSince = CBA_missionTime - GVAR(lastFragTime); if (_ammo isEqualTo "" || {_posASL isEqualTo [0,0,0] || _timeSince < ACE_FRAG_HOLDOFF}) exitWith { - TRACE_3("timeExit",_timeSince,CBA_missionTime,GVAR(lastFragTime)); + TRACE_3("timeExit",_timeSince,CBA_missionTime,GVAR(lastFragTime)); }; GVAR(lastFragTime) = CBA_missionTime; private _maxFrags = round (linearConversion [0.1, 1.5, _timeSince, ACE_FRAG_COUNT_MIN, ACE_FRAG_COUNT_MAX, true]); @@ -52,7 +52,6 @@ if (_heightAGL < 0.25) then { _posASL = _posASL vectorAdd [0, 0, 0.25]; }; -// !*! make holdoff a gvar? TRACE_3("fnc_doFragTargeted IF", _fragRange, _timeSince, GVAR(fragSimComplexity)); if (_fragRange > 3 && _timeSince > ACE_FRAG_HOLDOFF*1.5 && GVAR(fragSimComplexity) != 1) then { _maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted)); diff --git a/addons/frag/functions/fnc_doFragRandom.sqf b/addons/frag/functions/fnc_doFragRandom.sqf index 8a31bf6787..f095e3fd43 100644 --- a/addons/frag/functions/fnc_doFragRandom.sqf +++ b/addons/frag/functions/fnc_doFragRandom.sqf @@ -39,7 +39,7 @@ private _hMode = switch (true) do { }; private _type = if (count _fragType > 0 && - {"ace_frag_tiny" isEqualTo (_fragType#0)}) then { + {"ace_frag_tiny" isEqualTo (_fragType#0)}) then { QGVAR(def_tiny_) } else { QGVAR(def_small_) @@ -69,6 +69,6 @@ _fragSpawner addEventHandler [ } ]; if (GVAR(dbgSphere)) then { - [_posASL] call FUNC(dev_sphereDraw); + [_posASL] call FUNC(dev_sphereDraw); }; #endif \ No newline at end of file diff --git a/addons/frag/functions/fnc_doFragTargeted.sqf b/addons/frag/functions/fnc_doFragTargeted.sqf index d969ee98c6..f0fa8019ef 100644 --- a/addons/frag/functions/fnc_doFragTargeted.sqf +++ b/addons/frag/functions/fnc_doFragTargeted.sqf @@ -53,7 +53,7 @@ if (_objects isEqualTo []) exitWith { // grab crews and add them in so that targets stay approx. sorted by distance { private _crew = (crew _x); - if (count _crew > 1) then { + if (count _crew > 1) then { private _arr = [_x]; { _arr pushBackUnique _x; @@ -158,9 +158,9 @@ private _fragCount = 0; // limit of # of fragments to _maxFrags _fragObj setShotParents _shotPrnt; #ifdef DEBUG_MODE_DRAW [_fragObj, "purple", true] call FUNC(dev_trackObj); - if (GVAR(dbgSphere)) then { - [_targetPos, "orange"] call FUNC(dev_sphereDraw); - }; + if (GVAR(dbgSphere)) then { + [_targetPos, "orange"] call FUNC(dev_sphereDraw); + }; #endif _fragCount = _fragCount + _count; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 3c6752ca86..0a6d315035 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -19,12 +19,12 @@ TRACE_1("",_this); params [ "_projectile", ["_hitObj", objNull], -// "", +// "", ["_lPosASL", [0, 0, 0]], ["_lVel", [0, 0, 0]], ["_sNorm", [0, 0, 0]], -// "", -// "", +// "", +// "", ["_surfaceType", ""], ["_ammo", "", [""]], ["_shotParents", [objNull, objNull], [[]]], @@ -32,9 +32,9 @@ params [ ]; if (CBA_missionTime - GVAR(lastSpallTime) < ACE_FRAG_SPALL_HOLDOFF || - _lPosASL isEqualTo [0,0,0] || - {isNull _hitObj || {_hitObj isKindOf "man" || - {_ammo isEqualTo ""}}}) exitWith { + _lPosASL isEqualTo [0,0,0] || + {isNull _hitObj || {_hitObj isKindOf "man" || + {_ammo isEqualTo ""}}}) exitWith { TRACE_4("time/invldHit",CBA_missionTime,GVAR(lastSpallTime),_hitObj,_lPosASL); }; @@ -53,7 +53,7 @@ private _vel = if (alive _projectile) then { // Find spall speed / fragment private _dV = vectorMagnitude _lVel - vectorMagnitude _vel; -private _caliber = getNumber (configFile >> "cfgAmmo" >> _ammo >> "caliber"); // !*! optimize this later? +private _caliber = getNumber (configFile >> "cfgAmmo" >> _ammo >> "caliber"); // scaled momentum change made on caliber-mass assumption ~sqrt(2)/20 * caliber ~= mass private _deltaMomentum = 0.0707 * _caliber * sqrt( _dV ) * GVAR(SpallIntensity); TRACE_3("found speed",_dV,_caliber,_deltaMomentum); @@ -63,20 +63,19 @@ if (_deltaMomentum < 2) exitWith { }; -//** start calculating where the spalling should come !*! could be better **// private _lVelUnit = vectorNormalized _lVel; private _unitStep = _lVelUnit vectorMultiply 0.05; private _spallPos = +_lPosASL; - -if (120 > acos ((vectorNormalized _lVelUnit) vectorDotProduct _sNorm)) then { - _spallPos = _spallPos vectorAdd (_unitStep vectorMultiply 5); -}; - if (terrainIntersectASL [_lPosASL vectorAdd _unitStep, _lPosASL]) exitWith { TRACE_3("terrainIntersect",_lPosASL,_unitStep,_lPosASL); }; + +if (120 > acos ((vectorNormalized _lVelUnit) vectorDotProduct _sNorm)) then { + _spallPos = _spallPos vectorAdd (_unitStep vectorMultiply 5); +}; + //***** Passed all exit withs *****// GVAR(lastSpallTime) = CBA_missionTime; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index d6918a067a..182ee70c24 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -33,7 +33,8 @@ _shouldFrag params ["_doFrag", "_doSubmunit"]; if (_doFrag) then { // wait for frag damage to kill units before spawning fragments - _projectile addEventHandler ["Explode", { + _projectile addEventHandler ["Explode", + { if (isServer) then { [FUNC(doFrag), [_this]] call CBA_fnc_execNextFrame; } else { diff --git a/addons/frag/functions/fnc_getFragInfo.sqf b/addons/frag/functions/fnc_getFragInfo.sqf index 09c82476b6..40b9c9a4fc 100644 --- a/addons/frag/functions/fnc_getFragInfo.sqf +++ b/addons/frag/functions/fnc_getFragInfo.sqf @@ -9,11 +9,11 @@ * * Return Value: * _ammoInfo - * 0: _fragRange - search range for fragments - * 1: _fragVel - gurney equation calculated velocity - * 2: _fragTypes - array of fragment types - * 3: _fragCount - modified frag count used under assumptions - * of spherical fragmentation + * 0: _fragRange - search range for fragments + * 1: _fragVel - gurney equation calculated velocity + * 2: _fragTypes - array of fragment types + * 3: _fragCount - modified frag count used under assumptions + * of spherical fragmentation * * Example: * ["B_556x45_Ball"] call ace_frag_fnc_getFragInfo; @@ -74,7 +74,7 @@ if (_warn) then { // 1: _fragVel - gurney equation calculated velocity // 2: _fragTypes - array of fragment types // 3: _fragCount - modified frag count used under assumptions -// of spherical fragmentation +// of spherical fragmentation _ammoInfo = [ sqrt (_fragCount / (4 * pi * 0.005)), 0.8 * _gC * sqrt (_c / (_m + _c * _k)), diff --git a/addons/frag/functions/fnc_getMaterialInfo.sqf b/addons/frag/functions/fnc_getMaterialInfo.sqf index b471a5c573..34d401a1a2 100644 --- a/addons/frag/functions/fnc_getMaterialInfo.sqf +++ b/addons/frag/functions/fnc_getMaterialInfo.sqf @@ -29,11 +29,11 @@ if (isClass (configFile >> "CfgSurfaces" >> _surfType)) then { _material = getText (configFile >> "CfgSurfaces" >> _surfType >> "soundEnviron"); } else { // Messy way when a surface isn't added to cfgSurfaces private _surfFileText = tolower preprocessFile _surfType; - _surfFileText = _surfFileText regexReplace ["[^a-z0-9]", ""]; - private _idx = 12 + (_surfFileText find "soundenviron"); - if (_surfFileText select [_idx, 5] isEqualTo "empty") then { - _idx = 8 + (_surfFileText find "soundhit"); - }; + _surfFileText = _surfFileText regexReplace ["[^a-z0-9]", ""]; + private _idx = 12 + (_surfFileText find "soundenviron"); + if (_surfFileText select [_idx, 5] isEqualTo "empty") then { + _idx = 8 + (_surfFileText find "soundhit"); + }; _material = _surfFileText select [_idx, 10]; }; TRACE_1("materialSubString",_material); @@ -46,7 +46,7 @@ _material = switch (true) do { case ("rock" in _material): { "rock" }; case ("wood" in _material): { "wood" }; case ("lino" in _material); - case ("building" in _material); + case ("building" in _material); case ("concrete" in _material): { "concrete" }; case ("metal" in _material): { "metal" }; default { "ground" }; diff --git a/addons/frag/functions/fnc_shouldFrag.sqf b/addons/frag/functions/fnc_shouldFrag.sqf index 35a85623f3..fbfb32b9f8 100644 --- a/addons/frag/functions/fnc_shouldFrag.sqf +++ b/addons/frag/functions/fnc_shouldFrag.sqf @@ -9,7 +9,7 @@ * * Return Value: * _shouldFrag - * 0 - Should the specific round fragment + * 0 - Should the specific round fragment * 1 - Does the munition have a child submunition * * Example: diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index 08b9369802..6d44d8061a 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -25,7 +25,6 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; 1 ] call CBA_fnc_addSetting; -/// !*! TODO: add stringtable entries [ QGVAR(fragSimComplexity), "LIST", [LSTRING(FragMode), LSTRING(FragMode_Desc)], @@ -33,7 +32,7 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; [_category, LSTRING(Frag)], [[2, 1, 0], [LSTRING(FragMode_Opt2),LSTRING(FragMode_Opt1),LSTRING(FragMode_Opt0)], 2], // [[2, 1, 0], ["Targeted & random fragmentation","Random fragmentation","Unit targeted fragmentation"], 2], - true + true ] call CBA_fnc_addSetting; [ @@ -50,9 +49,9 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; // ["Fragmentation BlackList", "Array of ammo classnames strings to blackist fragmentation for."], [_category, LSTRING(Frag)], QUOTE(['B_556x45_Ball']), - true, - nil, - true + true, + nil, + true ] call CBA_fnc_addSetting; [ @@ -60,5 +59,5 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; [LSTRING(SpallIntensity), LSTRING(SpallIntensity_Desc)], [_category, LSTRING(Spall)], [0.1, 2, 1, 1], - true + true ] call CBA_fnc_addSetting;