summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-29 00:13:25 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-29 00:13:25 +0000
commitfa535d85d2b5f93099807aa16beec8e33b4dec53 (patch)
tree0e5959223eb052ad202ab86fe13896622be85cbb /src/map/mob.c
parenta05277071781a0f2f6a6f444d61a7957712d96a9 (diff)
downloadhercules-fa535d85d2b5f93099807aa16beec8e33b4dec53.tar.gz
hercules-fa535d85d2b5f93099807aa16beec8e33b4dec53.tar.bz2
hercules-fa535d85d2b5f93099807aa16beec8e33b4dec53.tar.xz
hercules-fa535d85d2b5f93099807aa16beec8e33b4dec53.zip
- Fixed a little spawn_timer bug. Discovered with a previous fix from ultramage and because of this spawn line:
npc/mobs/fields/prontera.txt: prt_fild06,222,30,40,10 monster Green Plant 1080,15,900000,450000,1 This is an impossible spawn area, and the engine just keep trying each 5 seconds to spawn it again. So we need to fix this line with a correct spawn too. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13497 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 91f5e4600..3ac4125e7 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -778,19 +778,17 @@ int mob_spawn (struct mob_data *md)
md->bl.x = md->spawn->x;
md->bl.y = md->spawn->y;
- if ((md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys)
+ if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
{ //Monster can be spawned on an area.
- if (!map_search_freecell(&md->bl, -1,
- &md->bl.x, &md->bl.y, md->spawn->xs, md->spawn->ys,
- battle_config.no_spawn_on_player?4:0)) {
- // retry again later
- add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
+ if( !map_search_freecell(&md->bl, -1, &md->bl.x, &md->bl.y, md->spawn->xs, md->spawn->ys, battle_config.no_spawn_on_player?4:0) )
+ { // retry again later
+ md->spawn_timer = add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
return 1;
}
- } else if (battle_config.no_spawn_on_player>99 &&
- map_foreachinrange(mob_count_sub, &md->bl, AREA_SIZE, BL_PC))
- { //retry again later (players on sight)
- add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
+ }
+ else if( battle_config.no_spawn_on_player > 99 && map_foreachinrange(mob_count_sub, &md->bl, AREA_SIZE, BL_PC) )
+ { // retry again later (players on sight)
+ md->spawn_timer = add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
return 1;
}
}