summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 16:37:06 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 16:37:06 +0000
commit9827189a901458193bbc0c66081ae9a50576fd20 (patch)
tree9b6f328cb3fdbb0ab890f24f3b9b854f833a9284 /src/map/atcommand.c
parent3adaf8788b65a84ec4266c6621d30679a95f546d (diff)
downloadhercules-9827189a901458193bbc0c66081ae9a50576fd20.tar.gz
hercules-9827189a901458193bbc0c66081ae9a50576fd20.tar.bz2
hercules-9827189a901458193bbc0c66081ae9a50576fd20.tar.xz
hercules-9827189a901458193bbc0c66081ae9a50576fd20.zip
Cleaned up mob_once_spawn() and mob_once_spawn_area().
- now they use mapid instead of mapname as input parameter - moved the responsibility to perform "this" -> mapid resolution to the caller - added a pair of swap() operations to prevent working with a negative-dimensioned area (fixes bugreport:87) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12022 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 816484cdd..b9ec2c72c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2454,7 +2454,7 @@ int atcommand_monster(const int fd, struct map_session_data* sd, const char* com
range = (int)sqrt(number) +2; // calculation of an odd number (+ 4 area around)
for (i = 0; i < number; i++) {
map_search_freecell(&sd->bl, 0, &mx, &my, range, range, 0);
- k = mob_once_spawn(sd, "this", mx, my, name, mob_id, 1, "");
+ k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, "");
count += (k != 0) ? 1 : 0;
}
@@ -2539,7 +2539,7 @@ int atcommand_monstersmall(const int fd, struct map_session_data* sd, const char
my = sd->bl.y + (rand() % 11 - 5);
else
my = y;
- count += (mob_once_spawn((struct map_session_data*)sd, "this", mx, my, name, mob_id, 1, "2") != 0) ? 1 : 0;
+ count += (mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, "2") != 0) ? 1 : 0;
}
if (count != 0)
@@ -2615,7 +2615,7 @@ int atcommand_monsterbig(const int fd, struct map_session_data* sd, const char*
my = sd->bl.y + (rand() % 11 - 5);
else
my = y;
- count += (mob_once_spawn((struct map_session_data*)sd, "this", mx, my, name, mob_id, 1, "4") != 0) ? 1 : 0;
+ count += (mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, "4") != 0) ? 1 : 0;
}
if (count != 0)