From f2a0ea907f3bbc0f48f7007b333ef06e19255add Mon Sep 17 00:00:00 2001 From: zephyrus Date: Tue, 17 Mar 2009 22:39:22 +0000 Subject: - Battleground mapflags: * 1 = no scoreboard (as Tierra Valley is). * 2 = scoreboard enable (as Flavius and KvM requires). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13594 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/npc.c b/src/map/npc.c index 0a37986c8..a1d22368e 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2725,13 +2725,22 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con if (state) map[m].flag.pvp=0; } else if (!strcmpi(w3,"battleground")) { - map[m].flag.battleground = state; - if( state && map[m].flag.pvp ) + if( state ) + { + if( sscanf(w4, "%d", &state) == 1 ) + map[m].flag.battleground = state; + else + map[m].flag.battleground = 1; // Default value + } + else + map[m].flag.battleground = 0; + + if( map[m].flag.battleground && map[m].flag.pvp ) { map[m].flag.pvp = 0; ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer)); } - if( state && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) + if( map[m].flag.battleground && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) { map[m].flag.gvg = 0; map[m].flag.gvg_dungeon = 0; -- cgit v1.2.3-60-g2f50