Fix vending machine manager wire error (#37100)
Skip updating amounts for removed entries
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user