Can no longer place an infinite quantity of items inside a microwave (#23577)
* initial commit * rewrote code to early return to reduce nesting * added VV to Capacity field of MicrowaveComponent
This commit is contained in:
@@ -66,6 +66,9 @@ namespace Content.Server.Kitchen.Components
|
|||||||
public int CurrentCookTimeButtonIndex;
|
public int CurrentCookTimeButtonIndex;
|
||||||
|
|
||||||
public Container Storage = default!;
|
public Container Storage = default!;
|
||||||
|
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public int Capacity = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class BeingMicrowavedEvent : HandledEntityEventArgs
|
public sealed class BeingMicrowavedEvent : HandledEntityEventArgs
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ using Robust.Shared.Audio.Systems;
|
|||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Shared.Access.Components;
|
||||||
|
|
||||||
namespace Content.Server.Kitchen.EntitySystems
|
namespace Content.Server.Kitchen.EntitySystems
|
||||||
{
|
{
|
||||||
@@ -260,6 +261,12 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ent.Comp.Storage.Count >= ent.Comp.Capacity)
|
||||||
|
{
|
||||||
|
_popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-full"), ent, args.User);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
_handsSystem.TryDropIntoContainer(args.User, args.Used, ent.Comp.Storage);
|
_handsSystem.TryDropIntoContainer(args.User, args.Used, ent.Comp.Storage);
|
||||||
UpdateUserInterfaceState(ent, ent.Comp);
|
UpdateUserInterfaceState(ent, ent.Comp);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ microwave-component-suicide-others-message = {$victim} is trying to cook their h
|
|||||||
microwave-component-suicide-multi-head-message = You cook your heads!
|
microwave-component-suicide-multi-head-message = You cook your heads!
|
||||||
microwave-component-suicide-message = You cook your head!
|
microwave-component-suicide-message = You cook your head!
|
||||||
microwave-component-upgrade-cook-time = cook time
|
microwave-component-upgrade-cook-time = cook time
|
||||||
|
microwave-component-interact-full = It's full.
|
||||||
|
|
||||||
## Bound UI
|
## Bound UI
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
description: It's magic.
|
description: It's magic.
|
||||||
components:
|
components:
|
||||||
- type: Microwave
|
- type: Microwave
|
||||||
|
capacity: 10
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: GenericVisualizer
|
- type: GenericVisualizer
|
||||||
visuals:
|
visuals:
|
||||||
|
|||||||
Reference in New Issue
Block a user