summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-25 02:34:20 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-25 02:34:20 +0000
commit71402dcc1b56c68896a043a66faec201826ac289 (patch)
tree6aa06f6b7f1dffb2032d302ff097bc0ad53140de /src/map/pet.c
parent772e0b2424215a39c7291f67c311768ed685989a (diff)
downloadhercules-71402dcc1b56c68896a043a66faec201826ac289.tar.gz
hercules-71402dcc1b56c68896a043a66faec201826ac289.tar.bz2
hercules-71402dcc1b56c68896a043a66faec201826ac289.tar.xz
hercules-71402dcc1b56c68896a043a66faec201826ac289.zip
- Fixed pet hatching.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5743 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 67d457e55..ed7309808 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -374,13 +374,13 @@ int pet_return_egg(struct map_session_data *sd)
clif_additem(sd,0,0,flag);
map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
}
+ sd->pet.incuvate = 1;
intif_save_petdata(sd->status.account_id,&sd->pet);
unit_free(&sd->pd->bl);
if(battle_config.pet_status_support && sd->pet.intimate > 0)
status_calc_pc(sd,0);
memset(&sd->pet, 0, sizeof(struct s_pet));
sd->status.pet_id = 0;
- sd->pet.incuvate = 1;
sd->petDB = NULL;
}
@@ -396,12 +396,22 @@ int pet_data_init(struct map_session_data *sd)
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
- if(sd->status.account_id != sd->pet.account_id || sd->status.char_id != sd->pet.char_id ||
- sd->status.pet_id != sd->pet.pet_id) {
+ if(sd->status.account_id != sd->pet.account_id || sd->status.char_id != sd->pet.char_id) {
sd->status.pet_id = 0;
return 1;
}
-
+ if (sd->status.pet_id != sd->pet.pet_id) {
+ if (sd->status.pet_id) {
+ //Wrong pet?? Set incuvate to no and send it back for saving.
+ sd->pet.incuvate = 1;
+ intif_save_petdata(sd->status.account_id,&sd->pet);
+ sd->status.pet_id = 0;
+ return 1;
+ }
+ //The pet_id value was lost? odd... restore it.
+ sd->status.pet_id = sd->pet.pet_id;
+ }
+
i = search_petDB_index(sd->pet.class_,PET_CLASS);
if(i < 0) {
sd->status.pet_id = 0;