From 9a309db58c70c994d7f937a243b52fe27a6c1f1d Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 15 Aug 2006 21:12:45 +0000 Subject: - Cleaned up some of the pet related @/# commands, same for some script commands. - Moved s_pet structure from map_session_data to pet_data, this enabled the removal of a few redundant values in the pet_data structure (name, class, equip) - Pet offensive skills who's inf value is self will be casted on the pet now (for stuff like Grand Cross) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8301 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index cb03378e3..0c2973be6 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3300,12 +3300,12 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in sd->state.waitingdisconnect=1; pc_clean_skilltree(sd); if(sd->status.pet_id > 0 && sd->pd) { + intif_save_petdata(sd->status.account_id,&sd->pd->pet); unit_remove_map(&sd->pd->bl, clrtype); - intif_save_petdata(sd->status.account_id,&sd->pet); } if(sd->status.hom_id > 0 && sd->hd) { //orn - unit_remove_map(&sd->hd->bl, clrtype); intif_homunculus_requestsave(sd->status.account_id, &sd->homunculus); + unit_remove_map(&sd->hd->bl, clrtype); } chrif_save(sd,2); chrif_changemapserver(sd, mapindex, x, y, ip, (short)port); @@ -3351,7 +3351,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in sd->bl.x = sd->ud.to_x = x; sd->bl.y = sd->ud.to_y = y; - if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0) { + if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0) { sd->pd->bl.m = m; sd->pd->bl.x = sd->pd->ud.to_x = x; sd->pd->bl.y = sd->pd->ud.to_y = y; @@ -4773,11 +4773,12 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) if(sd->status.pet_id > 0 && sd->pd) { + struct s_pet *pet = &sd->pd->pet; if(!map[sd->bl.m].flag.nopenalty){ - sd->pet.intimate -= sd->pd->petDB->die; - if(sd->pet.intimate < 0) - sd->pet.intimate = 0; - clif_send_petdata(sd,1,sd->pet.intimate); + pet->intimate -= sd->pd->petDB->die; + if(pet->intimate < 0) + pet->intimate = 0; + clif_send_petdata(sd,1,pet->intimate); } if(sd->pd->target_id) // Unlock all targets... pet_unlocktarget(sd->pd); @@ -7149,7 +7150,7 @@ static int pc_autosave_sub(DBKey key,void * data,va_list app) // pet if(sd->status.pet_id > 0 && sd->pd) - intif_save_petdata(sd->status.account_id,&sd->pet); + intif_save_petdata(sd->status.account_id,&sd->pd->pet); if(sd->state.finalsave) { //Save ack hasn't returned from char-server yet? Retry. -- cgit v1.2.3-60-g2f50