diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-20 16:38:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-20 16:38:41 +0300 |
commit | 8cc96fc6a97376a020b31fbb16196e3476f79ec5 (patch) | |
tree | 71e4c8dc49db7642df43ba68bcf1732643c46c4e /src/map/send.c | |
parent | 428c65b5c8d000d1cf3b3540de5bd91124c76113 (diff) | |
download | plugin-8cc96fc6a97376a020b31fbb16196e3476f79ec5.tar.gz plugin-8cc96fc6a97376a020b31fbb16196e3476f79ec5.tar.bz2 plugin-8cc96fc6a97376a020b31fbb16196e3476f79ec5.tar.xz plugin-8cc96fc6a97376a020b31fbb16196e3476f79ec5.zip |
map: add support for sending npc activate distance to client
Diffstat (limited to 'src/map/send.c')
-rw-r--r-- | src/map/send.c | 22 |
1 files changed, 19 insertions, 3 deletions
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) |