summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2015-12-12 12:52:28 +0200
committerHaru <haru@dotalux.com>2015-12-17 04:15:53 +0100
commitbb407e4e657c80115af8a8f5717e1f6f6dc61043 (patch)
tree63ae925756971fb7a6a840d40788c682714b48a4 /src/map/clif.c
parent478776d998e0fb48d87cd4c49229a1cf1b8cc203 (diff)
downloadhercules-bb407e4e657c80115af8a8f5717e1f6f6dc61043.tar.gz
hercules-bb407e4e657c80115af8a8f5717e1f6f6dc61043.tar.bz2
hercules-bb407e4e657c80115af8a8f5717e1f6f6dc61043.tar.xz
hercules-bb407e4e657c80115af8a8f5717e1f6f6dc61043.zip
Change all chat mute checks to use pc->can_talk instead of direct check.
Put new macro pc_ismuted and change all other kind of mutes to use it Closes #937 as merged Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 5030442f1..6fb7dd04e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10235,7 +10235,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) {
sd->sc.data[SC_TRICKDEAD] ||
sd->sc.data[SC_BLADESTOP] ||
sd->sc.data[SC_CLOAKINGEXCEED] ||
- (sd->sc.data[SC_NOCHAT] &&sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM)
+ pc_ismuted(&sd->sc, MANNER_NOITEM)
) )
break;
@@ -10271,7 +10271,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
if (sd->sc.count && (
sd->sc.data[SC_AUTOCOUNTER] ||
sd->sc.data[SC_BLADESTOP] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM)
+ pc_ismuted(&sd->sc, MANNER_NOITEM)
))
break;
@@ -10530,7 +10530,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
char s_password[CHATROOM_PASS_SIZE];
char s_title[CHATROOM_TITLE_SIZE];
- if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM)
+ if (pc_ismuted(&sd->sc, MANNER_NOROOM))
return;
if(battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 4) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,3);
@@ -11816,7 +11816,7 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
if( atcommand->exec(fd, sd, message, true) )
return;
- if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( !pc->can_talk(sd) )
return;
if (battle_config.min_chat_delay) {
@@ -12528,7 +12528,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
if( !flag )
sd->state.prevend = sd->state.workinprogress = 0;
- if( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM )
+ if(pc_ismuted(&sd->sc, MANNER_NOROOM))
return;
if( map->list[sd->bl.m].flag.novending ) {
clif->message (sd->fd, msg_sd(sd,276)); // "You can't open a shop on this map"
@@ -12920,7 +12920,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
if( atcommand->exec(fd, sd, message, true) )
return;
- if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( !pc->can_talk(sd) )
return;
if (battle_config.min_chat_delay) {
@@ -16016,7 +16016,7 @@ void clif_parse_BattleChat(int fd, struct map_session_data* sd)
if( atcommand->exec(fd, sd, message, true) )
return;
- if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( !pc->can_talk(sd) )
return;
if( battle_config.min_chat_delay ) {