Fixed OnBroken & OnImpact statuseffects not being applied client-side

This commit is contained in:
Joonas Rikkonen
2018-10-29 20:38:43 +02:00
parent 224e9238db
commit 33d971f5d0
2 changed files with 7 additions and 0 deletions

View File

@@ -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);

View File

@@ -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;