summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 18:08:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 18:08:37 +0000
commit66be3d8e66260ca148d768b887695729ded98abb (patch)
treec33bb1ccfd358b98cec22e750a395285ba5df31e /src/map/map.c
parent23d8fb13a79b0378db2ef6860d9b0b68cfacb9d6 (diff)
downloadhercules-66be3d8e66260ca148d768b887695729ded98abb.tar.gz
hercules-66be3d8e66260ca148d768b887695729ded98abb.tar.bz2
hercules-66be3d8e66260ca148d768b887695729ded98abb.tar.xz
hercules-66be3d8e66260ca148d768b887695729ded98abb.zip
- Corrected mob spawn utilization of the delay1/delay2 values (one is respawn delay base, the second is random variance added on top of it). Cleaned up related code.
- Changed abit map_add_block to prevent adding a player object which is invalid (not authed, waiting to be disconnected) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11964 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/map/map.c b/src/map/map.c
index e3c5aacbe..6050d6ed4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -349,10 +349,6 @@ int map_addblock_sub (struct block_list *bl, int flag)
return 1;
}
-#ifdef CELL_NOSTACK
- map_addblcell(bl);
-#endif
-
pos = x/BLOCK_SIZE+(y/BLOCK_SIZE)*map[m].bxs;
if (bl->type == BL_MOB) {
bl->next = map[m].block_mob[pos];
@@ -361,14 +357,13 @@ int map_addblock_sub (struct block_list *bl, int flag)
map[m].block_mob[pos] = bl;
map[m].block_mob_count[pos]++;
} else {
- bl->next = map[m].block[pos];
- bl->prev = &bl_head;
- if (bl->next) bl->next->prev = bl;
- map[m].block[pos] = bl;
- map[m].block_count[pos]++;
if (bl->type == BL_PC && flag)
{
struct map_session_data* sd;
+ if (!sd->state.auth) {
+ ShowError("map_addblock: Attempted to add a non-authed player (%d:%d)!\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
if (map[m].users++ == 0 && battle_config.dynamic_mobs) //Skotlex
map_spawnmobs(m);
sd = (struct map_session_data*)bl;
@@ -378,8 +373,17 @@ int map_addblock_sub (struct block_list *bl, int flag)
pet_menu(sd, 3); //Option 3 is return to egg.
}
}
+ bl->next = map[m].block[pos];
+ bl->prev = &bl_head;
+ if (bl->next) bl->next->prev = bl;
+ map[m].block[pos] = bl;
+ map[m].block_count[pos]++;
}
+#ifdef CELL_NOSTACK
+ map_addblcell(bl);
+#endif
+
return 0;
}