Fix adding items on critters with barter flag
This commit is contained in:
parent
cdafe0c654
commit
ac9293c3d5
|
@ -197,9 +197,18 @@ int itemAttemptAdd(Object* owner, Object* itemToAdd, int quantity)
|
|||
}
|
||||
} else if (parentType == OBJ_TYPE_CRITTER) {
|
||||
if (critterGetBodyType(owner) != BODY_TYPE_BIPED) {
|
||||
// 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);
|
||||
weightToAdd *= quantity;
|
||||
|
||||
|
|
Loading…
Reference in New Issue