Fixed OnBroken & OnImpact statuseffects not being applied client-side
This commit is contained in:
@@ -381,6 +381,7 @@ namespace Barotrauma
|
||||
(components[containerIndex] as ItemContainer).Inventory.ClientRead(type, msg, sendingTime);
|
||||
break;
|
||||
case NetEntityEvent.Type.Status:
|
||||
float prevCondition = condition;
|
||||
condition = msg.ReadSingle();
|
||||
if (FixRequirements.Count > 0)
|
||||
{
|
||||
@@ -395,6 +396,11 @@ namespace Barotrauma
|
||||
FixRequirements[i].Fixed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (prevCondition > 0.0f && condition <= 0.0f)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnBroken, 1.0f);
|
||||
}
|
||||
break;
|
||||
case NetEntityEvent.Type.ApplyStatusEffect:
|
||||
ActionType actionType = (ActionType)msg.ReadRangedInteger(0, Enum.GetValues(typeof(ActionType)).Length - 1);
|
||||
|
||||
@@ -960,6 +960,7 @@ namespace Barotrauma
|
||||
if (ImpactTolerance > 0.0f && impact > ImpactTolerance)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnImpact, 1.0f);
|
||||
GameMain.Server?.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnImpact });
|
||||
}
|
||||
|
||||
var containedItems = ContainedItems;
|
||||
|
||||
Reference in New Issue
Block a user