Fixed MP compat issue

This commit is contained in:
lambdatiger 2024-01-11 15:44:15 -06:00
parent d7f2f673f3
commit e290fd7c04
4 changed files with 14 additions and 26 deletions

View File

@ -6,7 +6,7 @@
}
#define ACE_FRAG_ADD_EH class EventHandlers {\
class ADDON {\
init = QUOTE(_this call FUNC(initRound););\
init = QUOTE(if (isServer) then {_this call FUNC(initRound);};);\
};\
}

View File

@ -1,4 +1,4 @@
#include "..\script_component.hpp"
#include "script_component.hpp"
ADDON = false;

View File

@ -18,6 +18,7 @@ params [
["_projectile", objNull, [objNull]]
];
private _ammo = typeOf _projectile;
if (_ammo isEqualTo "" || {isNull _projectile}) exitWith {
TRACE_2("bad ammo or projectile",_ammo,_projectile);
@ -32,17 +33,10 @@ if (_doFrag) then {
private _shotParents = getShotParents _proj;
private _ammo = typeOf _proj;
// wait for frag damage to kill units before spawning fragments
if (isServer) then {
[
FUNC(doFrag),
_this + [_ammo, _shotParents]
] call CBA_fnc_execNextFrame;
} else {
[
QGVAR(frag_eh),
_this + [_ammo, _shotParents]
] call CBA_fnc_serverEvent;
};
[
FUNC(doFrag),
_this + [_ammo, _shotParents]
] call CBA_fnc_execNextFrame;
}
];
};
@ -61,17 +55,10 @@ if (GVAR(spallEnabled) && {_shouldSpall}) then
private _shotPrnt = getShotParents _proj;
private _ammo = typeOf _proj;
private _vUp = vectorUp _proj;
if (isServer) then {
[
LINKFUNC(doSpall),
[_proj, _hitObj, _posASL, _vel, _sNorm, _surfType, _ammo, _shotPrnt, _vUp]
] call CBA_fnc_execNextFrame;
} else {
[
QGVAR(spall_eh),
[_proj, _hitObj, _posASL, _vel, _sNorm, _surfType, _ammo, _shotPrnt, _vUp]
] call CBA_fnc_serverEvent;
};
}
[
QGVAR(spall_eh),
[_proj, _hitObj, _posASL, _vel, _sNorm, _surfType, _ammo, _shotPrnt, _vUp]
] call CBA_fnc_serverEvent;
};
];
};

View File

@ -37,7 +37,8 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
QGVAR(atLeastOne), "CHECKBOX",
[LSTRING(MinFrag), LSTRING(MinFrag_Desc)],
[_category, LSTRING(Frag)],
true
false,
true
] call CBA_fnc_addSetting;
[