summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 1721e3db3..c66f6533b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3815,13 +3815,14 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
}
else if (!strcmpi(w3,"battleground")) {
struct map_zone_data *zone;
- if( state ) {
- if( sscanf(w4, "%d", &state) == 1 )
+ if (state) {
+ if (w4 && sscanf(w4, "%d", &state) == 1)
map->list[m].flag.battleground = state;
else
map->list[m].flag.battleground = 1; // Default value
- } else
+ } else {
map->list[m].flag.battleground = 0;
+ }
if( map->list[m].flag.battleground && map->list[m].flag.pvp ) {
map->list[m].flag.pvp = 0;