From 8cc96fc6a97376a020b31fbb16196e3476f79ec5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 Jan 2015 16:38:41 +0300 Subject: map: add support for sending npc activate distance to client --- src/map/send.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/map/send.c') diff --git a/src/map/send.c b/src/map/send.c index aa03de0..98772ff 100644 --- a/src/map/send.c +++ b/src/map/send.c @@ -11,6 +11,7 @@ #include "../../../common/socket.h" #include "../../../common/strlib.h" #include "../../../map/mob.h" +#include "../../../map/npc.h" #include "../../../map/pc.h" #include "../../../map/unit.h" @@ -134,12 +135,9 @@ void send_pc_info(struct block_list* bl1, return; struct map_session_data *sd = (struct map_session_data *)bl1; - struct SessionExt *data = session_get_bysd(sd); if (!data) return; - if (data->clientVersion < 4) - return; WBUFW (buf, 0) = 0xb0a; WBUFW (buf, 2) = 12; // len @@ -152,6 +150,24 @@ void send_pc_info(struct block_list* bl1, clif->send(&buf, sizeof(buf), bl2, target); } +void send_npc_info(struct block_list* bl1, + struct block_list* bl2, + enum send_target target) +{ + if (!bl1 || bl1->type != BL_NPC) + return; + + TBL_NPC *const nd = (TBL_NPC*)bl1; + + char buf[12]; + WBUFW (buf, 0) = 0xb0b; + WBUFW (buf, 2) = 12; // len + WBUFL (buf, 4) = nd->bl.id; + WBUFL (buf, 8) = nd->area_size; + + clif->send(&buf, sizeof(buf), bl2, target); +} + void send_advmoving(struct unit_data* ud, struct block_list *tbl, enum send_target target) { if (!ud) -- cgit v1.2.3-60-g2f50