From 184f0ed51d24cbc1eac68becfadfa6c7e50e9403 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 7 Aug 2006 17:43:53 +0000 Subject: - Cleaned some of mpeg's updated work. - Fixed HT_BLITZBEAT hitting neutral characters when it auto-triggers. - Simplified the Tatami Gaeshi code. - Fixed AS_SPLASHER doing full damage on everyone except targetted char instead of the other way around. - Fixed KAENSIN clearing out SUITON cells and viceversa. - The spawn area is now seen as range rather than absolute for mob spawn lines. This means that x,y,10,10 will spawn the mob on a 21x21 grid around the given x,y point. - Some clean up of the mob-spawn code. Now you can specify negative areas, so that a spawn location such as 100,150,0,-1 will spawn a mob always on x=100, but any Y value of the current map. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8165 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index 15cb12e6b..a7832a972 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -633,28 +633,18 @@ int mob_spawn (struct mob_data *md) if (md->spawn) { //Respawn data md->bl.m = md->spawn->m; + md->bl.x = md->spawn->x; + md->bl.y = md->spawn->y; - if ((md->spawn->x == 0 && md->spawn->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. - short x, y, xs, ys; - if (md->spawn->x == 0 && md->spawn->y == 0) - x = y = xs = ys = -1; - else { - x = md->spawn->x; - y = md->spawn->y; - xs = md->spawn->xs/2; - ys = md->spawn->ys/2; - } - if (!map_search_freecell(NULL, md->spawn->m, &x, &y, xs, ys, battle_config.no_spawn_on_player?5:1)) { + if (!map_search_freecell(NULL, -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); return 1; } - md->bl.x = x; - md->bl.y = y; - } else { - md->bl.x = md->spawn->x; - md->bl.y = md->spawn->y; } } memset(&md->state, 0, sizeof(md->state)); -- cgit v1.2.3-70-g09d2