From d1ef5355c484c6de06224551caf977b0ae1d3497 Mon Sep 17 00:00:00 2001 From: gepard1984 Date: Mon, 9 Jan 2012 23:18:01 +0000 Subject: Fixed battle configs `boss_delay_spawn`, `plant_delay_spawn` and `mob_delay_spawn` not being properly applied if changed during runtime (with `@reloadbattleconf` or `setbattleflag`) (bugreport:5204) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15416 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 0d112b937..eb99d8243 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2852,7 +2852,7 @@ void npc_parse_mob2(struct spawn_data* mob) static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath) { - int num, class_, mode, m,x,y,xs,ys, i,j; + int num, class_, m,x,y,xs,ys, i,j; char mapname[32]; struct spawn_data mob, *data; struct mob_db* db; @@ -2917,28 +2917,6 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c mob.xs = mob.ys = -1; } - db = mob_db(class_); - //Apply the spawn delay fix [Skotlex] - mode = db->status.mode; - if (mode & MD_BOSS) { //Bosses - if (battle_config.boss_spawn_delay != 100) - { // Divide by 100 first to prevent overflows - //(precision loss is minimal as duration is in ms already) - mob.delay1 = mob.delay1/100*battle_config.boss_spawn_delay; - mob.delay2 = mob.delay2/100*battle_config.boss_spawn_delay; - } - } else if (mode&MD_PLANT) { //Plants - if (battle_config.plant_spawn_delay != 100) - { - mob.delay1 = mob.delay1/100*battle_config.plant_spawn_delay; - mob.delay2 = mob.delay2/100*battle_config.plant_spawn_delay; - } - } else if (battle_config.mob_spawn_delay != 100) - { //Normal mobs - mob.delay1 = mob.delay1/100*battle_config.mob_spawn_delay; - mob.delay2 = mob.delay2/100*battle_config.mob_spawn_delay; - } - if(mob.delay1>0xfffffff || mob.delay2>0xfffffff) { ShowError("npc_parse_mob: Invalid spawn delays %u %u (file '%s', line '%d').\n", mob.delay1, mob.delay2, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue @@ -2960,6 +2938,7 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c } //Update mob spawn lookup database + db = mob_db(class_); for( i = 0; i < ARRAYLENGTH(db->spawn); ++i ) { if (map[mob.m].index == db->spawn[i].mapindex) -- cgit v1.2.3-60-g2f50