(c83fafea0) Fixed items in the characters inventory always starting at 100% condition client-side even if they had deteriorated during the previous round. Closes #1359

This commit is contained in:
Joonas Rikkonen
2019-03-27 12:10:35 +02:00
parent b6f6fd64a3
commit e5fd660479

View File

@@ -804,6 +804,11 @@ namespace Barotrauma
var newItem = Item.Load(itemElement, inventory.Owner.Submarine, createNetworkEvent: true);
if (newItem == null) { continue; }
if (!MathUtils.NearlyEqual(newItem.Condition, newItem.MaxCondition))
{
GameMain.NetworkMember.CreateEntityEvent(newItem, new object[] { NetEntityEvent.Type.Status });
}
int[] slotIndices = itemElement.GetAttributeIntArray("i", new int[] { 0 });
if (!slotIndices.Any())
{