Prevent mice from spilling containers. (#22812)

Added component on mouse prototype to prevent spill verb from being added
This commit is contained in:
Repo
2023-12-21 23:23:01 +13:00
committed by GitHub
parent 174dcac683
commit af76a4a76b
3 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
namespace Content.Server.Fluids.Components;
[RegisterComponent]
public sealed partial class PreventSpillerComponent : Component
{
}

View File

@@ -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")

View File

@@ -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