summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 21:12:45 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 21:12:45 +0000
commit9a309db58c70c994d7f937a243b52fe27a6c1f1d (patch)
treee3e40a7c60acb6a17687505da4197a77f355e1bf /src/map/pc.c
parent4aacac823607e804583d401bc2e27e7ca94865b6 (diff)
downloadhercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.gz
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.bz2
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.xz
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.zip
- 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c17
1 files changed, 9 insertions, 8 deletions
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.