diff options
Diffstat (limited to 'src/map/charcommand.c')
-rw-r--r-- | src/map/charcommand.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c index c4530dcd0..8772c18dc 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -148,20 +148,21 @@ is_charcommand(const int fd, struct map_session_data* sd, const char* message, i if (!*str)
return CharCommand_None;
- if (map[sd->bl.m].nocommand &&
- (gmlvl > 0? gmlvl:pc_isGM(sd)) < map[sd->bl.m].nocommand)
- { //Command not allowed on this map.
- char output[200];
- sprintf(output, msg_table[143]);
- clif_displaymessage(fd, output);
- return AtCommand_None;
- }
-
- type = charcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info);
+ if (!gmlvl) gmlvl = pc_isGM(sd);
+ type = charcommand(sd, gmlvl, str, &info);
if (type != CharCommand_None) {
char command[100];
char output[200];
const char* p = str;
+
+ if (map[sd->bl.m].nocommand &&
+ gmlvl < map[sd->bl.m].nocommand)
+ { //Command not allowed on this map.
+ sprintf(output, msg_txt(143));
+ clif_displaymessage(fd, output);
+ return AtCommand_None;
+ }
+
malloc_tsetdword(command, '\0', sizeof(command));
malloc_tsetdword(output, '\0', sizeof(output));
while (*p && !isspace(*p))
|