diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-20 00:16:34 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-20 00:16:34 +0000 |
commit | 79ea710ca5facb2c20fae16d6107dfa16a0f22bc (patch) | |
tree | 169d149a7a086272e764b67978fc3e599246cc2b /src/map | |
parent | 263a6ed472cf53802701a41577b96a62c571c10f (diff) | |
download | hercules-79ea710ca5facb2c20fae16d6107dfa16a0f22bc.tar.gz hercules-79ea710ca5facb2c20fae16d6107dfa16a0f22bc.tar.bz2 hercules-79ea710ca5facb2c20fae16d6107dfa16a0f22bc.tar.xz hercules-79ea710ca5facb2c20fae16d6107dfa16a0f22bc.zip |
- Fixed nocommand mapflag causing the "you can't use commands on this map" message to trigger one very single chat, instead of only for actual @/# command invocation.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8817 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 19 | ||||
-rw-r--r-- | src/map/charcommand.c | 21 |
2 files changed, 22 insertions, 18 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 8d3756441..5c579f05b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -807,17 +807,20 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int if (!*str)
return AtCommand_None;
- if (map[sd->bl.m].nocommand &&
- (gmlvl > 0? gmlvl:pc_isGM(sd)) < map[sd->bl.m].nocommand)
- { //Command not allowed on this map.
- sprintf(atcmd_output, msg_txt(143));
- clif_displaymessage(fd, atcmd_output);
- return AtCommand_None;
- }
- type = atcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info);
+ if (!gmlvl) gmlvl = pc_isGM(sd);
+ type = atcommand(sd, gmlvl, str, &info);
if (type != AtCommand_None) {
char command[100];
const char* p = str;
+
+ if (map[sd->bl.m].nocommand &&
+ gmlvl < map[sd->bl.m].nocommand)
+ { //Command not allowed on this map.
+ sprintf(atcmd_output, msg_txt(143));
+ clif_displaymessage(fd, atcmd_output);
+ return AtCommand_None;
+ }
+
malloc_tsetdword(command, '\0', sizeof(command));
malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
while (*p && !isspace(*p))
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))
|