summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 02:23:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 02:23:56 +0000
commit53796ffafd6eb381595b77cda1b039d795940e68 (patch)
treea33bec85a09564086f6b356a9e6d0e0797e9b079 /src/map/pet.c
parent454ae6b78937da966545207b94b1e0a037fdb098 (diff)
downloadhercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.gz
hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.bz2
hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.xz
hercules-53796ffafd6eb381595b77cda1b039d795940e68.zip
- Added structure view_data to handle sprite information for all characters (equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn)
- Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies. - Rewrote the way cloth dye packets are resent to optimize bandwidth usage. - Fixed the npc_item_flag thing (enable_items/disable_items script command) - Rewrote the disguise implementation to be bandwidth friendly. - Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around. - Rewrote several clif functions to adapt to the new view_data class; - Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 00994c723..4aef4e9b4 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -434,6 +434,7 @@ int pet_data_init(struct map_session_data *sd)
pd->bl.subtype = MONS;
pd->bl.type = BL_PET;
pd->msd = sd;
+ status_set_viewdata(&pd->bl,pd->class_);
unit_dataset(&sd->pd->bl);
pd->ud.dir = sd->ud.dir;
@@ -488,7 +489,7 @@ int pet_birth_process(struct map_session_data *sd)
chrif_save(sd,0); //FIXME: As before, is it REALLY Needed to save the char for hatching a pet? [Skotlex]
map_addblock(&sd->pd->bl);
- clif_spawnpet(sd->pd);
+ clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,0,0);
clif_send_petdata(sd,5,battle_config.pet_hair_style);
clif_pet_equip(sd->pd,sd->pet.equip);
@@ -533,7 +534,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
pet_data_init(sd);
if(sd->pd && sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
- clif_spawnpet(sd->pd);
+ clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,0,0);
clif_send_petdata(sd,5,battle_config.pet_hair_style);
// clif_pet_equip(sd->pd,sd->pet.equip);
@@ -736,7 +737,7 @@ int pet_change_name(struct map_session_data *sd,char *name)
memcpy(sd->pd->name, name, NAME_LENGTH-1);
clif_clearchar_area(&sd->pd->bl,0);
- clif_spawnpet(sd->pd);
+ clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,0,0);
clif_send_petdata(sd,5,battle_config.pet_hair_style);
sd->pet.rename_flag = 1;
@@ -971,8 +972,8 @@ static int pet_ai_sub_hard(struct pet_data *pd,unsigned int tick)
}
//Return speed to normal.
- if (pd->speed == 1 || pd->speed == sd->speed>>1);
- pd->speed = status_get_speed(&pd->bl);
+ if (pd->speed != sd->petDB->speed)
+ pd->speed == sd->petDB->speed;
if (pd->target_id) {
target= map_id2bl(pd->target_id);