2018-09-17 19:19:29 +00:00
|
|
|
#define DEBUG_MODE_FULL
|
2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-06-08 13:31:51 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE-Team
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_frag_fnc_debugAmmo
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-10-26 22:16:31 +00:00
|
|
|
params [
|
|
|
|
["_debugMissing", true, [false]],
|
|
|
|
["_debugForce", false, [false]],
|
2016-12-01 17:01:55 +00:00
|
|
|
["_debugSkippedFragPower", 30, [0]]
|
2016-10-26 22:16:31 +00:00
|
|
|
];
|
2016-05-07 20:35:39 +00:00
|
|
|
|
|
|
|
diag_log text format ["~~~~~~~~~~~~~Start [%1]~~~~~~~~~~~~~", _this];
|
|
|
|
|
|
|
|
private _allMagsConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true];
|
|
|
|
private _processedCfgAmmos = [];
|
|
|
|
|
|
|
|
{
|
|
|
|
private _ammo = toLower getText (_x >> "ammo");
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_ammo != "" && {!(_ammo in _processedCfgAmmos)}) then {
|
2016-05-07 20:35:39 +00:00
|
|
|
_processedCfgAmmos pushBack _ammo;
|
|
|
|
|
|
|
|
//Ignore mines/bombs
|
|
|
|
if (_ammo isKindOf "TimeBombCore") exitWith {};
|
|
|
|
|
|
|
|
_ammoConfig = configFile >> "CfgAmmo" >> _ammo;
|
|
|
|
|
|
|
|
//Read configs and test if it would actually cause a frag, using same logic as FUNC(pfhRound)
|
|
|
|
private _skip = getNumber (_ammoConfig >> QGVAR(skip));
|
|
|
|
private _explosive = getNumber (_ammoConfig >> "explosive");
|
|
|
|
private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange");
|
|
|
|
private _force = getNumber (_ammoConfig >> QGVAR(force));
|
2016-10-26 22:16:31 +00:00
|
|
|
private _fragPower = getNumber (_ammoConfig >> "indirecthit") * (sqrt ((getNumber (_ammoConfig >> "indirectHitRange"))));
|
2016-05-07 20:35:39 +00:00
|
|
|
|
|
|
|
private _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}};
|
|
|
|
|
|
|
|
if (_shouldAdd) then {
|
|
|
|
if (_debugForce && {((getNumber(_ammoConfig >> "hit")) < 5) || {_fragPower < 10}}) then {
|
2016-10-26 22:16:31 +00:00
|
|
|
diag_log text format ["Ammo [%1] from Mag [%2] - Weak but will still frag!", _ammo, configName _x];
|
|
|
|
diag_log text format [" - _force=%1,_fragPower=%2", _force, _fragPower];
|
2016-05-07 20:35:39 +00:00
|
|
|
};
|
2016-10-26 22:16:31 +00:00
|
|
|
|
|
|
|
private _warn = false;
|
2016-05-07 20:35:39 +00:00
|
|
|
|
2016-07-20 04:15:18 +00:00
|
|
|
_fragTypes = getArray (_ammoConfig >> QGVAR(CLASSES));
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_fragTypes isEqualTo []) then {_warn = true;};
|
2016-07-20 04:15:18 +00:00
|
|
|
_c = getNumber(_ammoConfig >> QGVAR(CHARGE));
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_c == 0) then {_warn = true;};
|
2016-07-20 04:15:18 +00:00
|
|
|
_m = getNumber(_ammoConfig >> QGVAR(METAL));
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_m == 0) then {_warn = true;};
|
2016-07-20 04:15:18 +00:00
|
|
|
_k = getNumber(_ammoConfig >> QGVAR(GURNEY_K));
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_k == 0) then {_warn = true;};
|
2016-07-20 04:15:18 +00:00
|
|
|
_gC = getNumber(_ammoConfig >> QGVAR(GURNEY_C));
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_gC == 0) then {_warn = true;};
|
2016-05-07 20:35:39 +00:00
|
|
|
|
2016-10-26 22:16:31 +00:00
|
|
|
if (_debugMissing && {_warn}) then {
|
|
|
|
diag_log text format ["Ammo [%1] from Mag [%2] MISSING frag configs:", _ammo, configName _x];
|
|
|
|
diag_log text format [" - _c=%1,_m=%2,_k=%3,_gC=%4,_fragTypes=%5", _c, _m, _k, _gC, _fragTypes];
|
2016-05-07 20:35:39 +00:00
|
|
|
};
|
|
|
|
} else {
|
2016-12-01 17:01:55 +00:00
|
|
|
if ((_fragPower > _debugSkippedFragPower) && {isArray (_ammoConfig >> QGVAR(CLASSES))}) then {
|
2016-10-26 22:16:31 +00:00
|
|
|
diag_log text format ["Ammo [%1] from Mag [%2] has frag configs but will NOT frag:", _ammo, configName _x];
|
|
|
|
diag_log text format ["- skip=%1,explosive=%2,indirectHitRange=%3,force=%4,fragPower=%5", _skip, _explosive, _indirectRange, _force, _fragPower];
|
2016-05-07 20:35:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach _allMagsConfigs;
|
|
|
|
|
|
|
|
diag_log text format ["~~~~~~~~~~~~~End [%1-%2]~~~~~~~~~~~~~", count _allMagsConfigs, count _processedCfgAmmos];
|