summaryrefslogtreecommitdiff
path: root/src/emap/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-30 21:10:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-30 21:10:18 +0300
commit2c9c1e2eb8e74a6f8d9765993365648555ddf9b0 (patch)
treeb2f83e8dda892954898205526bd0d4796ba52641 /src/emap/map.c
parentb826af28255cbd69318929aeb06b4164feed5588 (diff)
downloadevol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.gz
evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.bz2
evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.xz
evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.zip
Add missing checks.
Diffstat (limited to 'src/emap/map.c')
-rw-r--r--src/emap/map.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/emap/map.c b/src/emap/map.c
index 7e43f8b..4392132 100644
--- a/src/emap/map.c
+++ b/src/emap/map.c
@@ -79,7 +79,7 @@ int emap_addflooritem_post(int retVal,
if (fitem->cleartimer != INVALID_TIMER)
{
int timeout = battle->bc->flooritem_lifetime;
- struct ItemdExt *data = itemd_get_by_item(item);
+ struct ItemdExt *data = itemd_get_by_item(item);
if (data)
timeout = data->floorLifeTime;
timer->delete(fitem->cleartimer, map->clearflooritem_timer);
@@ -184,6 +184,8 @@ void emap_online_list(int fd)
static int getWalkMask(const struct block_list *bl)
{
int walkMask = 0;
+ if (!bl)
+ return 0;
if (bl->type == BL_NPC)
{
TBL_NPC *nd = (TBL_NPC *)bl;
@@ -367,8 +369,12 @@ void emap_setgatcell2(int16 m, int16 x, int16 y, int gat)
{
int j;
- if (m < 0 || m >= map->count ||
- x < 0 || x >= map->list[m].xs || y < 0 || y >= map->list[m].ys)
+ if (m < 0 ||
+ m >= map->count ||
+ x < 0 ||
+ x >= map->list[m].xs ||
+ y < 0 ||
+ y >= map->list[m].ys)
{
return;
}