Edible Verb Fixes (#39933)
* You cannot drink the cannot drink * Undo that shit * Whoops * Fix test fails --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bd519192d1
commit
d8172862c5
@@ -43,7 +43,7 @@ public sealed partial class IngestionSystem
|
||||
RaiseLocalEvent(target, ref ev);
|
||||
|
||||
//Prevents food usage with a wrong utensil
|
||||
if ((ev.Types & utensil.Comp.Types) == 0)
|
||||
if (ev.Types != UtensilType.None && (ev.Types & utensil.Comp.Types) == 0)
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("ingestion-try-use-wrong-utensil", ("verb", GetEdibleVerb(target)), ("food", target), ("utensil", utensil.Owner)), user, user);
|
||||
return true;
|
||||
|
||||
@@ -177,8 +177,10 @@ public sealed partial class IngestionSystem : EntitySystem
|
||||
/// </summary>
|
||||
/// <param name="food">Entity being eaten</param>
|
||||
/// <param name="stomachs">Stomachs available to digest</param>
|
||||
public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent, OrganComponent>> stomachs)
|
||||
/// <param name="popup">Should we also display popup text if it exists?</param>
|
||||
public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent, OrganComponent>> stomachs, out bool popup)
|
||||
{
|
||||
popup = false;
|
||||
var ev = new IsDigestibleEvent();
|
||||
RaiseLocalEvent(food, ref ev);
|
||||
|
||||
@@ -210,6 +212,7 @@ public sealed partial class IngestionSystem : EntitySystem
|
||||
}
|
||||
|
||||
// If we didn't find a stomach that can digest our food then it doesn't exist.
|
||||
popup = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -247,9 +250,9 @@ public sealed partial class IngestionSystem : EntitySystem
|
||||
return;
|
||||
|
||||
// Can we digest the specific item we're trying to eat?
|
||||
if (!IsDigestibleBy(args.Ingested, stomachs))
|
||||
if (!IsDigestibleBy(args.Ingested, stomachs, out var popup))
|
||||
{
|
||||
if (!args.Ingest)
|
||||
if (!args.Ingest || !popup)
|
||||
return;
|
||||
|
||||
if (forceFed)
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
slots:
|
||||
item:
|
||||
name: clothing-boots-sidearm
|
||||
priority: 4
|
||||
whitelist:
|
||||
tags:
|
||||
- Knife
|
||||
- Sidearm
|
||||
priority: 4
|
||||
|
||||
- type: entity
|
||||
abstract: true
|
||||
|
||||
Reference in New Issue
Block a user