summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/charcommand.c4
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/npc.c8
-rw-r--r--src/map/script.c4
5 files changed, 15 insertions, 9 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 10b226257..9ac6d6862 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -807,8 +807,8 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int
if (!*str)
return AtCommand_None;
- if (map[sd->bl.m].flag.nocommand &&
- (gmlvl > 0? gmlvl:pc_isGM(sd)) < battle_config.gm_skilluncond)
+ 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);
@@ -5820,7 +5820,7 @@ int atcommand_mapinfo(
clif_displaymessage(fd, atcmd_output);
strcpy(atcmd_output,"Other Flags: ");
- if (map[m_id].flag.nocommand)
+ if (map[m_id].nocommand)
strcat(atcmd_output, "NoCommand | ");
if (map[m_id].flag.nobaseexp)
strcat(atcmd_output, "NoBaseEXP | ");
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 66905faba..c4530dcd0 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -148,8 +148,8 @@ is_charcommand(const int fd, struct map_session_data* sd, const char* message, i
if (!*str)
return CharCommand_None;
- if (map[sd->bl.m].flag.nocommand &&
- (gmlvl > 0? gmlvl:pc_isGM(sd)) < battle_config.gm_skilluncond)
+ 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]);
diff --git a/src/map/map.h b/src/map/map.h
index 32394a3e7..b0b114f99 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1115,7 +1115,6 @@ struct map_data {
unsigned nomvploot : 1; // [Lorky]
unsigned nightenabled :1; //For night display. [Skotlex]
unsigned restricted : 1; // [Komurka]
- unsigned nocommand : 1; //Blocks @/# commands for non-gms. [Skotlex]
unsigned nodrop : 1;
unsigned novending : 1;
unsigned loadevent : 1;
@@ -1134,6 +1133,7 @@ struct map_data {
int zone; // [Komurka]
int jexp; // map experience multiplicator
int bexp; // map experience multiplicator
+ int nocommand; //Blocks @/# commands for non-gms. [Skotlex]
};
struct map_data_other_server {
diff --git a/src/map/npc.c b/src/map/npc.c
index 9c3b4f096..8e1cfd336 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2521,7 +2521,13 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
map[m].flag.nomvploot=state;
}
else if (strcmpi(w3,"nocommand")==0) { // Skotlex
- map[m].flag.nocommand=state;
+ if (state) {
+ if (sscanf(w4, "%d", &state) == 1)
+ map[m].nocommand =state;
+ else //No level specified, block everyone.
+ map[m].nocommand =100;
+ } else
+ map[m].nocommand=0;
}
else if (strcmpi(w3,"restricted")==0) { // Komurka
if (state) {
diff --git a/src/map/script.c b/src/map/script.c
index 4bd8d4186..73bf0d7d0 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -8317,7 +8317,7 @@ int buildin_setmapflag(struct script_state *st)
map[m].flag.restricted=1;
break;
case MF_NOCOMMAND:
- map[m].flag.nocommand=1;
+ map[m].nocommand = (!val || atoi(val) <= 0) ? 100 : atoi(val);
break;
case MF_JEXP:
map[m].jexp = (!val || atoi(val) < 0) ? 100 : atoi(val);
@@ -8461,7 +8461,7 @@ int buildin_removemapflag(struct script_state *st)
map[m].flag.restricted=0;
break;
case MF_NOCOMMAND:
- map[m].flag.nocommand=0;
+ map[m].nocommand=0;
break;
case MF_JEXP:
map[m].jexp=100;