summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-24 21:46:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-24 21:46:27 +0300
commite2fec6a64a403df523d64540f70c73b99fbf491c (patch)
tree34ee4d272252990071bd84cff303b956e4b57c21 /src/map/map.c
parentcf9c4ca35fefcf392269179785371b679689364c (diff)
downloadplugin-e2fec6a64a403df523d64540f70c73b99fbf491c.tar.gz
plugin-e2fec6a64a403df523d64540f70c73b99fbf491c.tar.bz2
plugin-e2fec6a64a403df523d64540f70c73b99fbf491c.tar.xz
plugin-e2fec6a64a403df523d64540f70c73b99fbf491c.zip
map: add missing checks.
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/map/map.c b/src/map/map.c
index ec7483b..6567337 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -36,7 +36,7 @@ int emap_addflooritem_post(int retVal,
int *flags __attribute__ ((unused)))
{
struct flooritem_data* fitem = (struct flooritem_data*)idb_get(map->id_db, retVal);
- if (fitem->cleartimer != INVALID_TIMER)
+ if (fitem && fitem->cleartimer != INVALID_TIMER)
{
int timeout = battle->bc->flooritem_lifetime;
struct ItemdExt *data = itemd_get_by_item(item);
@@ -56,6 +56,9 @@ void emap_online_list(int fd)
struct map_session_data* sd;
struct SessionExt *data1 = session_get(fd);
+ if (!data1)
+ return;
+
const time_t t = time(NULL);
if (data1->onlinelistlasttime + 15 >= t)
{ // not more than 1 per 15 seconds
@@ -64,6 +67,9 @@ void emap_online_list(int fd)
}
struct map_session_data* ssd = (struct map_session_data*)session[fd]->session_data;
+ if (!ssd)
+ return;
+
const bool showVersion = pc_has_permission(ssd, permission_show_client_version_flag);
data1->onlinelistlasttime = t;
@@ -78,6 +84,9 @@ void emap_online_list(int fd)
break;
struct SessionExt *data = session_get_bysd(sd);
+ if (!data)
+ continue;
+
// need skip invisible players
uint8 state = data->state;