summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-01 10:09:15 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-01 10:09:15 +0000
commitdf34f4498984a4d2d37faebe8809fddcd6f8e475 (patch)
tree04499672d129cac0078a82916411031238d9b266 /src/map/mob.c
parentdccedd13273e68218cca14df599962ef48170f29 (diff)
downloadhercules-df34f4498984a4d2d37faebe8809fddcd6f8e475.tar.gz
hercules-df34f4498984a4d2d37faebe8809fddcd6f8e475.tar.bz2
hercules-df34f4498984a4d2d37faebe8809fddcd6f8e475.tar.xz
hercules-df34f4498984a4d2d37faebe8809fddcd6f8e475.zip
* Fixed /resetstate /resetskill being unuseable at all
* Fixed /mm /mapmove being useable by all players * Fixed some compile errors in mob_once_spawn * Corrected a typo in Chemical Protection skills git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1195 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index c2702817a..30d066600 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -121,8 +121,8 @@ int mob_once_spawn(struct map_session_data *sd,char *mapname,
{
struct mob_data *md=NULL;
int m,count,lv=255,r=class_;
- int c,j=0;
-
+ int i, j;
+
if( sd )
lv=sd->status.base_level;
@@ -135,8 +135,8 @@ int mob_once_spawn(struct map_session_data *sd,char *mapname,
return 0;
if(class_<0){ // ランダムに召喚
- int i=0;
- int j=-class_-1;
+ i = 0;
+ j = -class_-1;
int k;
if(j>=0 && j<MAX_RANDOMMONSTER){
do{
@@ -157,18 +157,19 @@ int mob_once_spawn(struct map_session_data *sd,char *mapname,
if (x <= 0 || y <= 0) {
if (x <= 0) x = sd->bl.x + rand() % 3 - 1;
if (y <= 0) y = sd->bl.y + rand() % 3 - 1;
- if ((c = map_getcell(m, x, y)) == 1 || c == 5) {
+ if (map_getcell(m, x, y, CELL_CHKNOPASS)) {
x = sd->bl.x;
y = sd->bl.y;
}
}
} else if (x <= 0 || y <= 0) {
+ i = j = 0;
printf("mob_once_spawn: %i at %s x:%i y:%i\n ??\n",class_,map[m].name,x,y); //got idea from Freya [Lupus]
do {
x = rand() % (map[m].xs - 2) + 1;
y = rand() % (map[m].ys - 2) + 1;
- } while (((c = map_getcell(m, x, y)) == 1 || c == 5) && j++ < 64);
- if (c == 1 || c == 5) { // not solved?
+ } while ((i=map_getcell(m, x, y, CELL_CHKNOPASS)) && j++ < 64);
+ if (i) { // not solved?
x = 0;
y = 0;
}