Nullable messydrinker tag (#40002)

init
This commit is contained in:
ScarKy0 2025-08-31 01:35:22 +02:00 committed by Vanessa
parent 6803e48114
commit efdbdf0f19
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.
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<TagPrototype> SpillImmuneTag = "MessyDrinkerImmune";
public ProtoId<TagPrototype>? SpillImmuneTag = "MessyDrinkerImmune";
[DataField, AutoNetworkedField]
public LocId? SpillMessagePopup;

View 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.