From ac9293c3d55e5d50ed9926c85e00a32faad558a9 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Fri, 20 May 2022 10:30:04 +0300 Subject: [PATCH] Fix adding items on critters with barter flag --- src/item.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/item.c b/src/item.c index cf156fa..d51c148 100644 --- a/src/item.c +++ b/src/item.c @@ -197,7 +197,16 @@ int itemAttemptAdd(Object* owner, Object* itemToAdd, int quantity) } } else if (parentType == OBJ_TYPE_CRITTER) { if (critterGetBodyType(owner) != BODY_TYPE_BIPED) { - return -5; + // SFALL: Fix for being unable to plant items on non-biped critters + // with the "Barter" flag set (e.g. Skynet and Goris). + Proto* proto; + if (protoGetProto(owner->pid, &proto) == -1) { + return -5; + } + + if ((proto->critter.flags & 0x02) == 0) { + return -5; + } } int weightToAdd = itemGetWeight(itemToAdd);