summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 20:55:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 20:55:09 +0000
commit703867fcfd5e4040c354d39b9a850789ed3de812 (patch)
treedc567fae573a52f71f8b78bbf576654de7177802 /src/map/pet.c
parent13c3b8e817abaddba678717d5428844607dbf487 (diff)
downloadhercules-703867fcfd5e4040c354d39b9a850789ed3de812.tar.gz
hercules-703867fcfd5e4040c354d39b9a850789ed3de812.tar.bz2
hercules-703867fcfd5e4040c354d39b9a850789ed3de812.tar.xz
hercules-703867fcfd5e4040c354d39b9a850789ed3de812.zip
- Pet eggs won't be deleted upon selection for hatching, but on pet data retrieval now.
- Added check to pc_readdb to printout if a certain job is missing it's experience table. - Added Job_Wedding to db/const.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5272 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 28f5898f8..5d80f978d 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1032,9 +1032,23 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
return 1;
}
memcpy(&sd->pet,p,sizeof(struct s_pet));
- if(sd->pet.incuvate == 1)
- pet_birth_process(sd);
- else {
+ if(sd->pet.incuvate == 1) {
+ if (!pet_birth_process(sd))
+ {
+ int i;
+ //Delete egg from inventory. [Skotlex]
+ for (i = 0; i < MAX_INVENTORY; i++) {
+ if(sd->status.inventory[i].card[0] == (short)0xff00 &&
+ p->pet_id == MakeDWord(sd->status.inventory[i].card[1], sd->status.inventory[i].card[2]))
+ {
+ pc_delitem(sd,i,1,0);
+ break;
+ }
+ }
+ if(i >= MAX_INVENTORY && battle_config.error_log)
+ ShowError("pet_recv_petdata: Hatched pet (%d:%s), but couldn't find egg in inventory for removal!\n",p->pet_id, p->name);
+ }
+ } else {
pet_data_init(sd);
if(sd->pd && sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
@@ -1065,8 +1079,6 @@ int pet_select_egg(struct map_session_data *sd,short egg_index)
if(battle_config.error_log)
ShowError("wrong egg item inventory %d\n",egg_index);
}
- pc_delitem(sd,egg_index,1,0);
-
return 0;
}