From e0bb3903da841f9a6b1d3ac4850d12eb813dd00c Mon Sep 17 00:00:00 2001 From: Kex Date: Fri, 13 Sep 2024 00:52:32 +0200 Subject: [PATCH] Medical - Broadcast max heal setting to all clients (#93) Broadcast max heal setting to all clients --- .../SCR_HealSupportStationComponent.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/medical/scripts/Game/ACE_Medical/Components/SupportStation/SCR_HealSupportStationComponent.c b/addons/medical/scripts/Game/ACE_Medical/Components/SupportStation/SCR_HealSupportStationComponent.c index 78869cbe..c88e31d7 100644 --- a/addons/medical/scripts/Game/ACE_Medical/Components/SupportStation/SCR_HealSupportStationComponent.c +++ b/addons/medical/scripts/Game/ACE_Medical/Components/SupportStation/SCR_HealSupportStationComponent.c @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------ modded class SCR_HealSupportStationComponent : SCR_BaseDamageHealSupportStationComponent -{ +{ //------------------------------------------------------------------------------------------------ //! Apply settings override protected void DelayedInit(IEntity owner) @@ -18,7 +18,17 @@ modded class SCR_HealSupportStationComponent : SCR_BaseDamageHealSupportStationC resource.SetResourceTypeEnabled(settings.m_bHealSupplyUsageEnabled); // Set how much medical kits can heal - if (InventoryItemComponent.Cast(owner.FindComponent(InventoryItemComponent))) + if (InventoryItemComponent.Cast(owner.FindComponent(InventoryItemComponent)) && m_fMaxHealScaled != settings.m_fMedicalKitMaxHealScaled) + { m_fMaxHealScaled = settings.m_fMedicalKitMaxHealScaled; + Rpc(RpcDo_ACE_Medical_SetMaxHealScaledBroadcast, settings.m_fMedicalKitMaxHealScaled); + } + } + + //------------------------------------------------------------------------------------------------ + [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)] + void RpcDo_ACE_Medical_SetMaxHealScaledBroadcast(float maxHealScaled) + { + m_fMaxHealScaled = maxHealScaled; } }