mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Possible shouldFrag legibility improvement
This commit is contained in:
parent
4913887e36
commit
66c566b772
@ -4,7 +4,7 @@
|
||||
* This function checks whether an ammunition type should create fragments.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Type of ammo to check <STRING>
|
||||
* 0: Ammo classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Should the specific round fragment <BOOL>
|
||||
@ -25,19 +25,25 @@ _shouldFrag = true;
|
||||
|
||||
private _ammoConfig = configFile >> "CfgAmmo" >> _ammo;
|
||||
private _skip = getNumber (_ammoConfig >> QGVAR(skip));
|
||||
private _force = getNumber (_ammoConfig >> QGVAR(force));
|
||||
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 {
|
||||
TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit);
|
||||
if (_skip == 1) then {
|
||||
_shouldFrag = false;
|
||||
TRACE_1("No frag: skip",_skip);
|
||||
};
|
||||
|
||||
private _force = getNumber (_ammoConfig >> QGVAR(force));
|
||||
if (_shouldFrag && _force == 0) then {
|
||||
private _explosive = getNumber (_ammoConfig >> "explosive");
|
||||
if (_explosive < 0.4) exitWith {
|
||||
_shouldFrag = false;
|
||||
TRACE_3("No frag: _explosive",_skip,_force,_explosive);
|
||||
};
|
||||
private _indirectHit = getNumber (_ammoConfig >> "indirectHit");
|
||||
private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange");
|
||||
if (_indirectHit < 3 ||
|
||||
{_indirectRange < 5 && _indirectHit < _indirectRange}) then {
|
||||
_shouldFrag = false;
|
||||
TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit);
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(shouldFragCache) set [_ammo, _shouldFrag];
|
||||
|
Loading…
Reference in New Issue
Block a user