diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 97d8ad9db..889deac49 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6127,9 +6127,7 @@ ACMD(npctalk) bool ifcolor=(*(info->command + 7) != 'c' && *(info->command + 7) != 'C')?0:1; unsigned int color = 0; - if (sd->sc.count && //no "chatting" while muted. - (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 false; if(!ifcolor) { @@ -6176,9 +6174,7 @@ ACMD(pettalk) return false; } - if (sd->sc.count && //no "chatting" while muted. - (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 false; if (!*message || sscanf(message, "%99[^\n]", mes) < 1) { @@ -6983,9 +6979,7 @@ ACMD(homtalk) sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay; } - if (sd->sc.count && //no "chatting" while muted. - (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 false; if (!homun_alive(sd->hd)) { @@ -7350,9 +7344,7 @@ ACMD(me) memset(tempmes, '\0', sizeof(tempmes)); memset(atcmd_output, '\0', sizeof(atcmd_output)); - if (sd->sc.count && //no "chatting" while muted. - (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 false; if (!*message || sscanf(message, "%199[^\n]", tempmes) < 0) { @@ -9812,7 +9804,7 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa return false; //Block NOCHAT but do not display it as a normal message - if ( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCOMMAND ) + if (pc_ismuted(&sd->sc, MANNER_NOCOMMAND)) return true; // skip 10/11-langtype's codepage indicator, if detected |