Browse Source

Converted ZC_SKILL_ENTRY2 to struct (#8965)

Lemongrass3110 3 months ago
parent
commit
92c6466141
2 changed files with 14 additions and 17 deletions
  1. 14 16
      src/map/clif.cpp
  2. 0 1
      src/map/clif_packetdb.hpp

+ 14 - 16
src/map/clif.cpp

@@ -5373,22 +5373,20 @@ void clif_getareachar_item( map_session_data& sd, flooritem_data& fitem ){
 
 /// Notifes client about Graffiti
 /// 01c9 <id>.L <creator id>.L <x>.W <y>.W <unit id>.B <visible>.B <has msg>.B <msg>.80B (ZC_SKILL_ENTRY2)
-static void clif_graffiti(struct block_list *bl, struct skill_unit *unit, enum send_target target) {
-	unsigned char buf[128];
-	
-	nullpo_retv(bl);
-	nullpo_retv(unit);
+static void clif_graffiti( skill_unit& unit, send_target target, block_list& bl ){
+	packet_graffiti_entry p = {};
+
+	p.PacketType = graffiti_entryType;
+	p.AID = unit.bl.id;
+	p.creatorAID = unit.group->src_id;
+	p.xPos = unit.bl.x;
+	p.yPos = unit.bl.y;
+	p.job = unit.group->unit_id;
+	p.isContens = 1;
+	p.isVisible = 1;
+	safestrncpy( p.msg, unit.group->valstr, sizeof( p.msg ) );
 
-	WBUFW(buf, 0) = 0x1c9;
-	WBUFL(buf, 2) = unit->bl.id;
-	WBUFL(buf, 6) = unit->group->src_id;
-	WBUFW(buf,10) = unit->bl.x;
-	WBUFW(buf,12) = unit->bl.y;
-	WBUFB(buf,14) = unit->group->unit_id;
-	WBUFB(buf,15) = 1;
-	WBUFB(buf,16) = 1;
-	safestrncpy(WBUFCP(buf,17),unit->group->valstr,MESSAGE_SIZE);
-	clif_send(buf,packet_len(0x1c9),bl,target);
+	clif_send( &p, sizeof( p ), &bl, target );
 }
 
 /// Notifies the client of a skill unit.
@@ -5421,7 +5419,7 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *unit,
 
 #if PACKETVER >= 3
 	if (unit_id == UNT_GRAFFITI) { // Graffiti [Valaris]
-		clif_graffiti(bl, unit, target);
+		clif_graffiti( *unit, target, *bl );
 		return;
 	}
 #endif

+ 0 - 1
src/map/clif_packetdb.hpp

@@ -229,7 +229,6 @@
 	packet(0x01c3,-1);
 	packet(0x01c6,4);
 	packet(0x01c7,2);
-	packet(0x01c9,97);
 	packet(0x01cb,9);
 	packet(0x01cc,9);
 	parseable_packet(0x01ce,6,clif_parse_AutoSpell,2);