summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-08-12 14:53:24 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-15 11:45:44 -0400
commit879243c8661a346291b1ca57ffe6cdfdef90598f (patch)
tree19a0c9557870606b06d1ecd02bcd78ee6f3e258a /src/map
parent657526889f6a36d79e34ab77e25377fd46d8905c (diff)
downloadtmwa-879243c8661a346291b1ca57ffe6cdfdef90598f.tar.gz
tmwa-879243c8661a346291b1ca57ffe6cdfdef90598f.tar.bz2
tmwa-879243c8661a346291b1ca57ffe6cdfdef90598f.tar.xz
tmwa-879243c8661a346291b1ca57ffe6cdfdef90598f.zip
do not send spell invocation back to the caster
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 726d45c..4cf1de2 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -229,6 +229,8 @@ void clif_send_sub(dumb_ptr<block_list> bl, const Buffer& buf,
break;
case SendWho::AREA_CHAT_WOC:
+ if (bl && bl == src_bl)
+ break;
if (is_deaf(bl)
&& !(bl->bl_type == BL::PC
&& pc_isGM(src_bl->is_player())))
@@ -236,8 +238,6 @@ void clif_send_sub(dumb_ptr<block_list> bl, const Buffer& buf,
clif_emotion_towards(src_bl, bl, EMOTE_IGNORED);
return;
}
- if (bl && bl == src_bl)
- return;
break;
}
@@ -3830,35 +3830,31 @@ RecvResult clif_parse_GlobalMessage(Session *s, dumb_ptr<map_session_data> sd)
return rv;
}
- if (!magic_message(sd, mbuf))
- {
- if (is_atcommand(s, sd, mbuf, GmLevel()))
- return rv;
+ if (magic_message(sd, mbuf))
+ return rv;
- /* Don't send chat that results in an automatic ban. */
- if (tmw_CheckChatSpam(sd, mbuf))
- {
- clif_displaymessage(s, "Your message could not be sent."_s);
- return rv;
- }
+ if (is_atcommand(s, sd, mbuf, GmLevel()))
+ return rv;
- /* It's not a spell/magic message, so send the message to others. */
+ /* Don't send chat that results in an automatic ban. */
+ if (tmw_CheckChatSpam(sd, mbuf))
+ {
+ clif_displaymessage(s, "Your message could not be sent."_s);
+ return rv;
+ }
- Buffer sendbuf;
- clif_message_sub(sendbuf, sd, mbuf);
- Buffer filteredBuf; // ManaPlus remote execution exploit prevention
- XString filtered = mbuf;
- if (mbuf.contains_seq("@@="_s) && mbuf.contains('|'))
- filtered = "##B##3[##1Impossible to see this message. Please update your client.##3]"_s;
- clif_message_sub(filteredBuf, sd, filtered);
+ Buffer sendbuf;
+ clif_message_sub(sendbuf, sd, mbuf);
- clif_send(sendbuf, sd, SendWho::AREA_CHAT_WOC,
- wrap<ClientVersion>(6), filteredBuf);
- }
+ Buffer filteredBuf; // ManaPlus remote execution exploit prevention
+ XString filtered = mbuf;
+ if (mbuf.contains_seq("@@="_s) && mbuf.contains('|'))
+ filtered = "##B##3[##1Impossible to see this message. Please update your client.##3]"_s;
+ clif_message_sub(filteredBuf, sd, filtered);
- /* Send the message back to the speaker. */
- send_packet_repeatonly<0x008e, 4, 1>(s, STRPRINTF("%s : %s"_fmt, battle_get_name(sd), mbuf));
+ clif_send(sendbuf, sd, SendWho::AREA_CHAT_WOC,
+ wrap<ClientVersion>(6), filteredBuf);
return rv;
}