Prevent mice from spilling containers. (#22812)
Added component on mouse prototype to prevent spill verb from being added
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Content.Server.Fluids.Components;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed partial class PreventSpillerComponent : Component
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ namespace Content.Server.Fluids.EntitySystems;
|
|||||||
public sealed partial class PuddleSystem
|
public sealed partial class PuddleSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly OpenableSystem _openable = default!;
|
[Dependency] private readonly OpenableSystem _openable = default!;
|
||||||
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
|
|
||||||
private void InitializeSpillable()
|
private void InitializeSpillable()
|
||||||
{
|
{
|
||||||
@@ -184,6 +185,10 @@ public sealed partial class PuddleSystem
|
|||||||
if (solution.Volume == FixedPoint2.Zero)
|
if (solution.Volume == FixedPoint2.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (_entityManager.HasComponent<PreventSpillerComponent>(args.User))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
Verb verb = new()
|
Verb verb = new()
|
||||||
{
|
{
|
||||||
Text = Loc.GetString("spill-target-verb-get-data-text")
|
Text = Loc.GetString("spill-target-verb-get-data-text")
|
||||||
|
|||||||
@@ -1290,6 +1290,7 @@
|
|||||||
needsHands: true
|
needsHands: true
|
||||||
- type: BadFood
|
- type: BadFood
|
||||||
- type: NonSpreaderZombie
|
- type: NonSpreaderZombie
|
||||||
|
- type: PreventSpiller
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: MobMouse
|
parent: MobMouse
|
||||||
|
|||||||
Reference in New Issue
Block a user