summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
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 3d22baa80..fe4b32a12 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -288,28 +288,26 @@ int mob_once_spawn (struct map_session_data *sd, char *mapname,
}
strncpy(data.eventname, event, 50);
- if (sd && (x < 0 || y < 0))
- { //Locate spot around player.
+ if (sd && (x < 0 || y < 0)) //Locate spot around player.
map_search_freecell(&sd->bl, m, &x, &y, 1, 1, 0);
- data.x = x;
- data.y = y;
- }
if (x <= 0 || y <= 0 || map_getcell(m,x,y,CELL_CHKNOREACH))
rand_flag = 1; //Randomize spot on map for each mob.
-
+ else {
+ data.x = x;
+ data.y = y;
+ }
if (!mob_parse_dataset(&data))
return 0;
for (count = 0; count < amount; count++) {
if (rand_flag) { //Get a random cell for this mob.
map_search_freecell(NULL, m, &x, &y, -1, -1, 1);
+ // This should ALWAYS be done. [blackhole89]
+ data.x = x;
+ data.y = y;
}
- // This should ALWAYS be done. [blackhole89]
- data.x = x;
- data.y = y;
-
md =mob_spawn_dataset (&data);
if (class_ < 0 && battle_config.dead_branch_active)