|
@@ -1484,23 +1484,27 @@ static void clif_set_unit_walking( struct block_list& bl, map_session_data* tsd,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/// Changes sprite of an NPC object (ZC_NPCSPRITE_CHANGE).
|
|
|
-/// 01b0 <id>.L <type>.B <value>.L
|
|
|
-/// type:
|
|
|
-/// unused
|
|
|
-void clif_class_change_target(struct block_list *bl,int class_,int type, enum send_target target, map_session_data *sd)
|
|
|
-{
|
|
|
- nullpo_retv(bl);
|
|
|
+/// Changes sprite of a non player object.
|
|
|
+/// 01b0 <id>.L <type>.B <value>.L (ZC_NPCSPRITE_CHANGE)
|
|
|
+void clif_class_change( block_list& bl, int32 class_, enum send_target target, map_session_data* sd ){
|
|
|
+ if( pcdb_checkid( class_ ) ){
|
|
|
+ // player classes yield missing sprites
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if(!pcdb_checkid(class_))
|
|
|
- {// player classes yield missing sprites
|
|
|
- unsigned char buf[16];
|
|
|
- WBUFW(buf,0)=0x1b0;
|
|
|
- WBUFL(buf,2)=bl->id;
|
|
|
- WBUFB(buf,6)=type;
|
|
|
- WBUFL(buf,7)=class_;
|
|
|
- clif_send(buf,packet_len(0x1b0),(sd == nullptr ? bl : &(sd->bl)),target);
|
|
|
+ PACKET_ZC_NPCSPRITE_CHANGE p = {};
|
|
|
+
|
|
|
+ p.packetType = HEADER_ZC_NPCSPRITE_CHANGE;
|
|
|
+ p.GID = bl.id;
|
|
|
+ // Unused
|
|
|
+ p.type = 0;
|
|
|
+ p.class_ = class_;
|
|
|
+
|
|
|
+ if( sd != nullptr ){
|
|
|
+ bl = sd->bl;
|
|
|
}
|
|
|
+
|
|
|
+ clif_send( &p, sizeof( p ), &bl, target );
|
|
|
}
|
|
|
|
|
|
void clif_servantball( map_session_data& sd, struct block_list* target, enum send_target send_target ){
|