Skip to content
Permalink
Browse files

Merge pull request #2428 from hemagx/hercules_pet_fixes

Automatically migrate pets to the new system that keeps hatched eggs in the inventory
  • Loading branch information...
MishimaHaruna committed Apr 17, 2019
2 parents 0013040 + e700c49 commit 1351986ee45b6cbc444c0ae1b23eb2e03dbf75e7
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/map/pet.c
@@ -348,6 +348,21 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
if (i != sd->status.inventorySize) {
sd->status.inventory[i].attribute &= ~ATTR_BROKEN;
sd->status.inventory[i].bound = IBT_NONE;
} else {
// The pet egg wasn't found: it was probably hatched with the old system that deleted the egg.
struct item tmp_item = {0};
int flag;

tmp_item.nameid = pd->petDB->EggID;
tmp_item.identify = 1;
tmp_item.card[0] = CARD0_PET;
tmp_item.card[1] = GetWord(pd->pet.pet_id, 0);
tmp_item.card[2] = GetWord(pd->pet.pet_id, 1);
tmp_item.card[3] = pd->pet.rename_flag;
if ((flag = pc->additem(sd, &tmp_item, 1, LOG_TYPE_EGG)) != 0) {
clif->additem(sd, 0, 0, flag);
map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false);
}
}
#if PACKETVER >= 20180704
clif->inventoryList(sd);

0 comments on commit 1351986

Please sign in to comment.
You can’t perform that action at this time.