fix: refuse to add horse if one is already owned #1973
@ -789,6 +789,10 @@ export const addItem = async (
 | 
				
			|||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                case "NeutralCreatures": {
 | 
					                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 });
 | 
					                    const horseIndex = inventory.Horses.push({ ItemType: typeName });
 | 
				
			||||||
                    return {
 | 
					                    return {
 | 
				
			||||||
                        Horses: [inventory.Horses[horseIndex - 1].toJSON<IEquipmentClient>()]
 | 
					                        Horses: [inventory.Horses[horseIndex - 1].toJSON<IEquipmentClient>()]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user