Skip to content

Commit

Permalink
Update DeepFryerWindow.xaml.cs
Browse files Browse the repository at this point in the history
Unknown if correct

Fixed fatal errors, not aware if fixes it ingame correctly
  • Loading branch information
Adrian16199 committed Oct 7, 2023
1 parent 68d0498 commit 2cf5626
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Content.Client.Kitchen.UI
public sealed partial class DeepFryerWindow : DefaultWindow
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IClientEntityManager EntMan = default!;

private static readonly Color WarningColor = Color.FromHsv(new Vector4(0.0f, 1.0f, 0.8f, 1.0f));

Expand Down Expand Up @@ -45,16 +46,19 @@ public void UpdateState(DeepFryerBoundUserInterfaceState state)

foreach (var entity in state.ContainedEntities)
{
if (_entityManager.Deleted(entity))

EntityUid serverEnt = default;

if (EntMan.Deleted(serverEnt))
continue;

// Duplicated from MicrowaveBoundUserInterface.cs: keep an eye on that file for when it changes.
Texture? texture;
if (_entityManager.TryGetComponent(entity, out IconComponent? iconComponent))
if (EntMan.TryGetComponent<IconComponent>(serverEnt, out var iconComponent))
{
texture = _entityManager.System<SpriteSystem>().GetIcon(iconComponent);
texture = EntMan.System<SpriteSystem>().GetIcon(iconComponent);
}
else if (_entityManager.TryGetComponent(entity, out SpriteComponent? spriteComponent))
else if (EntMan.TryGetComponent<SpriteComponent>(serverEnt, out var spriteComponent))
{
texture = spriteComponent.Icon?.Default;
}
Expand All @@ -63,7 +67,7 @@ public void UpdateState(DeepFryerBoundUserInterfaceState state)
continue;
}

ItemList.AddItem(_entityManager.GetComponent<MetaDataComponent>(entity).EntityName, texture);
ItemList.AddItem(EntMan.GetComponent<MetaDataComponent>(serverEnt).EntityName, texture);
}
}
}
Expand Down

0 comments on commit 2cf5626

Please sign in to comment.