diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 4e1f621e43..6334c53702 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -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);};);\ };\ } diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index 1db6baf311..c13f60edb3 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -1,4 +1,4 @@ -#include "..\script_component.hpp" +#include "script_component.hpp" ADDON = false; diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index a9c692e7f4..6dfa4de486 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -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; + }; ]; }; \ No newline at end of file diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index 29841cae57..5d51dc00bb 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -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; [