summaryrefslogtreecommitdiff
path: root/src/map/clif.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/clif.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/clif.c')
-rw-r--r--src/map/clif.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index f41b428f9..4a2c63fca 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6350,18 +6350,21 @@ int clif_send_petdata(struct map_session_data *sd,int type,int param)
int clif_send_petstatus(struct map_session_data *sd)
{
int fd;
+ struct s_pet *pet;
nullpo_retr(0, sd);
+ nullpo_retr(0, sd->pd);
fd=sd->fd;
+ pet = &sd->pd->pet;
WFIFOHEAD(fd,packet_len_table[0x1a2]);
WFIFOW(fd,0)=0x1a2;
- memcpy(WFIFOP(fd,2),sd->pet.name,NAME_LENGTH);
- WFIFOB(fd,26)=(battle_config.pet_rename == 1)? 0:sd->pet.rename_flag;
- WFIFOW(fd,27)=sd->pet.level;
- WFIFOW(fd,29)=sd->pet.hungry;
- WFIFOW(fd,31)=sd->pet.intimate;
- WFIFOW(fd,33)=sd->pet.equip;
+ memcpy(WFIFOP(fd,2),pet->name,NAME_LENGTH);
+ WFIFOB(fd,26)=(battle_config.pet_rename == 1)? 0:pet->rename_flag;
+ WFIFOW(fd,27)=pet->level;
+ WFIFOW(fd,29)=pet->hungry;
+ WFIFOW(fd,31)=pet->intimate;
+ WFIFOW(fd,33)=pet->equip;
WFIFOSET(fd,packet_len_table[0x1a2]);
return 0;
@@ -6385,7 +6388,7 @@ int clif_pet_emotion(struct pet_data *pd,int param)
if(pd->petDB->talk_convert_class < 0)
return 0;
else if(pd->petDB->talk_convert_class > 0) {
- param -= (pd->class_ - 100)*100;
+ param -= (pd->pet.class_ - 100)*100;
param += (pd->petDB->talk_convert_class - 100)*100;
}
}
@@ -7824,7 +7827,7 @@ int clif_charnameack (int fd, struct block_list *bl)
memcpy(WBUFP(buf,6), ((struct homun_data*)bl)->master->homunculus.name, NAME_LENGTH);
break;
case BL_PET:
- memcpy(WBUFP(buf,6), ((struct pet_data*)bl)->name, NAME_LENGTH);
+ memcpy(WBUFP(buf,6), ((struct pet_data*)bl)->pet.name, NAME_LENGTH);
break;
case BL_NPC:
memcpy(WBUFP(buf,6), ((struct npc_data*)bl)->name, NAME_LENGTH);
@@ -8315,8 +8318,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i));
}
- if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 900)
- clif_pet_emotion(sd->pd,(sd->pd->class_ - 100)*100 + 50 + pet_hungry_val(sd));
+ if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 900)
+ clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd));
//Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex]
//[LuzZza]
//clif_guild_send_onlineinfo(sd);