]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Nullable messydrinker tag (#40002)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sat, 30 Aug 2025 23:35:22 +0000 (01:35 +0200)
committerGitHub <noreply@github.com>
Sat, 30 Aug 2025 23:35:22 +0000 (01:35 +0200)
init

Content.Shared/Nutrition/Components/MessyDrinkerComponent.cs
Content.Shared/Nutrition/EntitySystems/MessyDrinkerSystem.cs

index ea145019c2c44f2822f2672d6315ad5a9a554a76..11342727994b2d7c73aa7b408e216936cb616e59 100644 (file)
@@ -32,7 +32,7 @@ public sealed partial class MessyDrinkerComponent : Component
     /// For example, a spill-immune bottle.
     /// </summary>
     [DataField, AutoNetworkedField]
-    public ProtoId<TagPrototype> SpillImmuneTag = "MessyDrinkerImmune";
+    public ProtoId<TagPrototype>? SpillImmuneTag = "MessyDrinkerImmune";
 
     [DataField, AutoNetworkedField]
     public LocId? SpillMessagePopup;
index d75e7bf018863a0d5573a381dce5f3cbd6a4c220..7bfb7a5633de581a68874e773a5fbf1e3ae0c4a0 100644 (file)
@@ -25,7 +25,7 @@ public sealed class MessyDrinkerSystem : EntitySystem
 
     private void OnIngested(Entity<MessyDrinkerComponent> ent, ref IngestingEvent ev)
     {
-        if (_tag.HasTag(ev.Food, ent.Comp.SpillImmuneTag))
+        if (ent.Comp.SpillImmuneTag != null && _tag.HasTag(ev.Food, ent.Comp.SpillImmuneTag.Value))
             return;
 
         // Cannot spill if you're being forced to drink.