Fix vending machine manager wire error (#37100)

Skip updating amounts for removed entries
This commit is contained in:
Tayrtahn 2025-05-01 20:21:59 -04:00 committed by deltanedas
parent dc86e72ebb
commit fee5467d18
1 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ using Robust.Client.UserInterface;
using Content.Client.UserInterface.Controls;
using Content.Shared.IdentityManagement;
using Robust.Client.Graphics;
using Robust.Shared.Utility;
namespace Content.Client.VendingMachines.UI
{
@ -162,7 +163,9 @@ namespace Content.Client.VendingMachines.UI
continue;
var dummy = _dummies[proto];
var amount = cachedInventory.First(o => o.ID == proto).Amount;
if (!cachedInventory.TryFirstOrDefault(o => o.ID == proto, out var entry))
continue;
var amount = entry.Amount;
// Could be better? Problem is all inventory entries get squashed.
var text = GetItemText(dummy, amount);