Skip to content

Commit

Permalink
Medical - Broadcast max heal setting to all clients (#93)
Browse files Browse the repository at this point in the history
Broadcast max heal setting to all clients
  • Loading branch information
Kexanone authored Sep 12, 2024
1 parent 95eda00 commit e0bb390
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------------------------
modded class SCR_HealSupportStationComponent : SCR_BaseDamageHealSupportStationComponent
{
{
//------------------------------------------------------------------------------------------------
//! Apply settings
override protected void DelayedInit(IEntity owner)
Expand All @@ -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;
}
}

0 comments on commit e0bb390

Please sign in to comment.