From b8b21edf63e58270e7744548c73e1c5ef64b7950 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Thu, 2 Dec 2010 18:50:34 +0000 Subject: * Fixed mapflags not getting initialized upon @reloadscript (bugreport:2247, since r1275). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14548 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 7fa7d4f7a..be2c53526 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2797,6 +2797,20 @@ int map_delmap(char* mapname) return 0; } +/// Initializes map flags and adjusts them depending on configuration. +void map_flags_init(void) +{ + int i; + + for( i = 0; i < map_num; i++ ) + { + memset(&map[i].flag, 0, sizeof(map[i].flag)); + + if( battle_config.pk_mode ) + map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris] + } +} + #define NO_WATER 1000000 /* @@ -2958,8 +2972,6 @@ int map_readallmaps (void) map[i].m = i; memset(map[i].moblist, 0, sizeof(map[i].moblist)); //Initialize moblist [Skotlex] map[i].mob_delete_timer = INVALID_TIMER; //Initialize timer [Skotlex] - if(battle_config.pk_mode) - map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris] map[i].bxs = (map[i].xs + BLOCK_SIZE - 1) / BLOCK_SIZE; map[i].bys = (map[i].ys + BLOCK_SIZE - 1) / BLOCK_SIZE; @@ -2973,6 +2985,9 @@ int map_readallmaps (void) map[i].block_mob = (struct block_list**)aCalloc(size, 1); } + // intialization and configuration-dependent adjustments of mapflags + map_flags_init(); + if( !enable_grf ) { fclose(fp); -- cgit v1.2.3-70-g09d2