summaryrefslogtreecommitdiff
path: root/src/map/clif.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-05-23 10:17:10 -0400
committermekolat <mekolat@users.noreply.github.com>2015-06-20 06:49:37 -0400
commitef9eb6bde90ec1d9d175b6481935cb3bd67d6c6c (patch)
tree2deb6c5804f9dae3157848f775e9a2ed233d3db0 /src/map/clif.cpp
parentdb20d783fe41bb9b44b92461f9843a31146a5ce7 (diff)
downloadtmwa-ef9eb6bde90ec1d9d175b6481935cb3bd67d6c6c.tar.gz
tmwa-ef9eb6bde90ec1d9d175b6481935cb3bd67d6c6c.tar.bz2
tmwa-ef9eb6bde90ec1d9d175b6481935cb3bd67d6c6c.tar.xz
tmwa-ef9eb6bde90ec1d9d175b6481935cb3bd67d6c6c.zip
add clif_message_towards
Diffstat (limited to 'src/map/clif.cpp')
-rw-r--r--src/map/clif.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 73315d8..db5ecd2 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -3809,19 +3809,16 @@ RecvResult clif_parse_GlobalMessage(Session *s, dumb_ptr<map_session_data> sd)
return rv;
}
-void clif_message(dumb_ptr<block_list> bl, XString msg)
+static
+void clif_message_sub(Buffer& buf, dumb_ptr<block_list> bl, XString msg)
{
size_t msg_len = msg.size() + 1;
if (msg_len + 16 > 512)
return;
- nullpo_retv(bl);
-
Packet_Head<0x008d> head_8d;
head_8d.block_id = bl->bl_id;
- Buffer buf = create_vpacket<0x008d, 8, 1>(head_8d, msg);
-
- clif_send(buf, bl, SendWho::AREA, MIN_CLIENT_VERSION);
+ buf = create_vpacket<0x008d, 8, 1>(head_8d, msg);
}
void clif_npc_send_title(Session *s, BlockId npcid, XString msg)
@@ -3854,6 +3851,28 @@ void clif_change_music(dumb_ptr<map_session_data> sd, XString music)
send_buffer(sd->sess, buf);
}
+void clif_message_towards(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> bl, XString msg)
+{
+ nullpo_retv(bl);
+ nullpo_retv(sd);
+
+ if(!sd)
+ return;
+
+ Buffer buf;
+ clif_message_sub(buf, bl, msg);
+ clif_send(buf, sd, SendWho::SELF, MIN_CLIENT_VERSION);
+}
+
+void clif_message(dumb_ptr<block_list> bl, XString msg)
+{
+ nullpo_retv(bl);
+
+ Buffer buf;
+ clif_message_sub(buf, bl, msg);
+ clif_send(buf, bl, SendWho::AREA, MIN_CLIENT_VERSION);
+}
+
/*==========================================
*
*------------------------------------------