diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 6aa001b9ef..563cb4deee 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -217,13 +217,15 @@ if (isNil QGVAR(level)) then { }, 0, []] call CBA_fnc_addPerFrameHandler; -// broadcast injuries to JIP clients in a MP session -if (isMultiplayer) then { - // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. - if (hasInterface) then { - { - [_x, player] call FUNC(requestWoundSync); - }foreach units group player; +if (USE_WOUND_EVENT_SYNC) then { + // broadcast injuries to JIP clients in a MP session + if (isMultiplayer) then { + // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. + if (hasInterface) then { + { + [_x, player] call FUNC(requestWoundSync); + }foreach units group player; + }; }; }; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 24605a3f97..40c9bd4bd6 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -21,7 +21,9 @@ GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} els GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; -[_target, ACE_player] call FUNC(requestWoundSync); +if (USE_WOUND_EVENT_SYNC) then { + [_target, ACE_player] call FUNC(requestWoundSync); +}; if (_show) then { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"]; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index ceac7c5f60..b2d7b3514d 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -123,18 +123,20 @@ _woundsCreated = []; }; }foreach (_injuryTypeInfo select 0); -_unit setvariable [QGVAR(openWounds), _openWounds]; +_unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; // Only update if new wounds have been created if (count _woundsCreated > 0) then { _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -// TODO Should this be done in a single broadcast? -// Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. -{ - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); -}foreach _woundsCreated; +if (USE_WOUND_EVENT_SYNC) then { + // TODO Should this be done in a single broadcast? + // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _woundsCreated; +}; _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 91475a03dc..1a602bd702 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -23,8 +23,10 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(bloodPressure), [0, 0]]; _unit setvariable [QGVAR(airwayStatus), 0]; - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _openWounds; + if (USE_WOUND_EVENT_SYNC) then { + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _openWounds; + }; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 39eab67fb8..1531a6858f 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -85,10 +85,11 @@ _impact = if ((_mostEffectiveInjury select 3) >= _effectivenessFound) then {_eff _mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _effectivenessFound) max 0]; _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury]; -_target setvariable [QGVAR(openWounds), _openWounds]; - -["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent); +_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; +if (USE_WOUND_EVENT_SYNC) then { + ["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent); +}; // Handle the reopening of bandaged wounds if (_impact > 0) then { // TODO handle reopening of bandaged wounds diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp index ad45e06a3e..939a811a41 100644 --- a/addons/medical/script_component.hpp +++ b/addons/medical/script_component.hpp @@ -10,3 +10,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define USE_WOUND_EVENT_SYNC false