}
}
- component.SortedHands = new(state.HandNames);
+ component.SortedHands.Clear();
+ component.SortedHands.AddRange(state.HandNames);
var sorted = addedHands.OrderBy(hand => component.SortedHands.IndexOf(hand.Name));
foreach (var hand in sorted)
public HandsComponentState(HandsComponent handComp)
{
+ // cloning lists because of test networking.
Hands = new(handComp.Hands.Values);
- HandNames = handComp.SortedHands;
+ HandNames = new(handComp.SortedHands);
ActiveHand = handComp.ActiveHand?.Name;
}
}
if (!handsComp.Hands.Remove(handName, out var hand))
return;
+ handsComp.SortedHands.Remove(hand.Name);
TryDrop(uid, hand, null, false, true, handsComp);
hand.Container?.Shutdown();
- handsComp.SortedHands.Remove(hand.Name);
if (handsComp.ActiveHand == hand)
TrySetActiveHand(uid, handsComp.SortedHands.FirstOrDefault(), handsComp);