mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Frag - Fix fuse-arming distance calculation (#8628)
This commit is contained in:
parent
fc6b1b7fa1
commit
76524f7c26
@ -60,7 +60,7 @@ if (alive _round) then {
|
|||||||
private _spallTrackID = [];
|
private _spallTrackID = [];
|
||||||
|
|
||||||
private _args = [
|
private _args = [
|
||||||
_round, getPosASL _round, velocity _round, _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
|
_round, getPosASL _round, velocity _round, _type, diag_frameno, getPosASL _round, _doSpall, _spallTrack, _spallTrackID,
|
||||||
getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)),
|
getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)),
|
||||||
getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"),
|
getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"),
|
||||||
getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"),
|
getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"),
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_gun", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
|
params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_firedPos", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
|
||||||
|
|
||||||
if (_round in GVAR(blackList)) exitWith {
|
if (_round in GVAR(blackList)) exitWith {
|
||||||
false
|
false
|
||||||
@ -26,13 +26,10 @@ if (!alive _round) exitWith {
|
|||||||
if (_skip == 0) then {
|
if (_skip == 0) then {
|
||||||
if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then {
|
if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then {
|
||||||
// shotbullet, shotShell don't seem to explode when touching water, so don't create frags
|
// shotbullet, shotShell don't seem to explode when touching water, so don't create frags
|
||||||
if (((_lastPos select 2) < 0) && {(toLower getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {};
|
if ((surfaceIsWater _lastPos) && {(toLower getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {};
|
||||||
private _isArmed = true;
|
private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance");
|
||||||
if (!isNil "_gun") then {
|
private _isArmed = _firedPos vectorDistance _lastPos >= _fuseDist; // rounds explode at exactly fuseDistance, so check inclusive
|
||||||
private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance");
|
TRACE_2("",_fuseDist,_isArmed);
|
||||||
_isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist);
|
|
||||||
TRACE_2("",_fuseDist,_isArmed);
|
|
||||||
};
|
|
||||||
if (!_isArmed) exitWith {TRACE_1("round not armed",_this);};
|
if (!_isArmed) exitWith {TRACE_1("round not armed",_this);};
|
||||||
TRACE_3("Sending frag event to server",_lastPos,_lastVel,_shellType);
|
TRACE_3("Sending frag event to server",_lastPos,_lastVel,_shellType);
|
||||||
[QGVAR(frag_eh), [_lastPos,_lastVel,_shellType]] call CBA_fnc_serverEvent;
|
[QGVAR(frag_eh), [_lastPos,_lastVel,_shellType]] call CBA_fnc_serverEvent;
|
||||||
|
Loading…
Reference in New Issue
Block a user