summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2013-04-19 22:16:23 -0300
committerMatheus Macabu <mkbu95@gmail.com>2013-04-19 22:16:23 -0300
commit0a671eff2ed01610d05e60529fbcc5be440189dc (patch)
tree45e8f221896223d714bb09541ee590a93b653ae8 /src/map/pet.c
parent904caf6f8c77f50f7d89725cec7b8bc200406ae5 (diff)
downloadhercules-0a671eff2ed01610d05e60529fbcc5be440189dc.tar.gz
hercules-0a671eff2ed01610d05e60529fbcc5be440189dc.tar.bz2
hercules-0a671eff2ed01610d05e60529fbcc5be440189dc.tar.xz
hercules-0a671eff2ed01610d05e60529fbcc5be440189dc.zip
* 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 <mkbu95@gmail.com>
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c10
1 files changed, 10 insertions, 0 deletions
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: