From 0a671eff2ed01610d05e60529fbcc5be440189dc Mon Sep 17 00:00:00 2001 From: Matheus Macabu Date: Fri, 19 Apr 2013 22:16:23 -0300 Subject: * Partial fix for bugreport:1222, if you have a pet and the pet egg is flagged as non-droppable and your inventory is full and you try to return the pet to the egg, the egg would drop; now you won't be able to return the pet to the egg. * Fix for @item, if you use an egg id it would create it regardless of your inventory limit, dropping the item if your inventory is full; now it won't create the egg. Signed-off-by: Matheus Macabu --- src/map/pet.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/map') diff --git a/src/map/pet.c b/src/map/pet.c index 28f841809..930158676 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -76,6 +76,7 @@ int pet_create_egg(struct map_session_data *sd, int item_id) { int pet_id = search_petDB_index(item_id, PET_EGG); if (pet_id < 0) return 0; //No pet egg here. + if (!pc_inventoryblank(sd)) return 0; // Inventory full sd->catch_target_class = pet_db[pet_id].class_; intif_create_pet(sd->status.account_id, sd->status.char_id, (short)pet_db[pet_id].class_, @@ -582,6 +583,7 @@ static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap); int pet_menu(struct map_session_data *sd,int menunum) { + struct item_data *egg_id; nullpo_ret(sd); if (sd->pd == NULL) return 1; @@ -589,6 +591,14 @@ int pet_menu(struct map_session_data *sd,int menunum) //You lost the pet already. if(!sd->status.pet_id || sd->pd->pet.intimate <= 0 || sd->pd->pet.incuvate) return 1; + + egg_id = itemdb_exists(sd->pd->petDB->EggID); + if (egg_id) { + if ((egg_id->flag.trade_restriction&0x01) && !pc_inventoryblank(sd)) { + clif_displaymessage(sd->fd, msg_txt(sd, 451)); // You can't return your pet because your inventory is full. + return 1; + } + } switch(menunum) { case 0: -- cgit v1.2.3-60-g2f50