Now able to eat things without eat behavior
This commit is contained in:
parent
127380f1f0
commit
c04ed062f7
|
@ -49,11 +49,14 @@ export const eat = new Command(
|
|||
if (foundObject.objtype == "fish") thingy = "fish";
|
||||
|
||||
const bhv = itemBehaviorMap[thingy];
|
||||
if (!bhv) return `The ${foundObject.name} isn't edible.`;
|
||||
if (bhv) {
|
||||
if (!bhv["eat"]) return `You can't eat the ${foundObject.name}.`;
|
||||
|
||||
const res = await runBehavior(thingy, "eat", foundObject, props);
|
||||
shouldRemove = res.shouldRemove;
|
||||
} else {
|
||||
shouldRemove = true;
|
||||
}
|
||||
|
||||
if (shouldRemove) {
|
||||
if (foundObject.objtype == "fish") {
|
||||
|
|
|
@ -2,6 +2,7 @@ import { addBack } from "@server/backs";
|
|||
import Command from "@server/commands/Command";
|
||||
import { logger } from "@server/commands/handler";
|
||||
import { getInventory, updateInventory } from "@server/data/inventory";
|
||||
import prisma from "@server/data/prisma";
|
||||
import { getUser } from "@server/data/user";
|
||||
import { getSizeString } from "@server/fish/fish";
|
||||
import { fishers, getFishing } from "@server/fish/fishers";
|
||||
|
|
Loading…
Reference in New Issue