Nullable messydrinker tag (#40002)

init
This commit is contained in:
ScarKy0
2025-08-31 01:35:22 +02:00
committed by GitHub
parent 3b95ab390b
commit c89b20b19f
2 changed files with 2 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ public sealed partial class MessyDrinkerComponent : Component
/// For example, a spill-immune bottle. /// For example, a spill-immune bottle.
/// </summary> /// </summary>
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField]
public ProtoId<TagPrototype> SpillImmuneTag = "MessyDrinkerImmune"; public ProtoId<TagPrototype>? SpillImmuneTag = "MessyDrinkerImmune";
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField]
public LocId? SpillMessagePopup; public LocId? SpillMessagePopup;

View File

@@ -25,7 +25,7 @@ public sealed class MessyDrinkerSystem : EntitySystem
private void OnIngested(Entity<MessyDrinkerComponent> ent, ref IngestingEvent ev) 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; return;
// Cannot spill if you're being forced to drink. // Cannot spill if you're being forced to drink.