fix: refuse to add horse if one is already owned (#1973)
All checks were successful
Build Docker image / docker (push) Successful in 1m9s
Build / build (push) Successful in 1m20s

Reviewed-on: #1973
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-05-03 17:24:47 -07:00 committed by Sainan
parent ff3a9b382c
commit cad82cf7de

View File

@ -789,6 +789,10 @@ export const addItem = async (
break;
}
case "NeutralCreatures": {
if (inventory.Horses.length != 0) {
logger.warn("refusing to add Horse because account already has one");
return {};
}
const horseIndex = inventory.Horses.push({ ItemType: typeName });
return {
Horses: [inventory.Horses[horseIndex - 1].toJSON<IEquipmentClient>()]