summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/data/mobd.c11
-rw-r--r--src/emap/data/mobd.h2
-rw-r--r--src/emap/map.c9
3 files changed, 22 insertions, 0 deletions
diff --git a/src/emap/data/mobd.c b/src/emap/data/mobd.c
index c0dc9ca..cb55e05 100644
--- a/src/emap/data/mobd.c
+++ b/src/emap/data/mobd.c
@@ -20,6 +20,9 @@
struct MobdExt *mobd_get(struct mob_db *md)
{
+ if (!md)
+ return NULL;
+
struct MobdExt *data = getFromMOBDB(md, 0);
if (!data)
{
@@ -29,6 +32,14 @@ struct MobdExt *mobd_get(struct mob_db *md)
return data;
}
+struct MobdExt *mobd_get_by_mob(TBL_MOB *md)
+{
+ if (!mob)
+ return NULL;
+
+ return mobd_get(mob->db_data[md->class_]);
+}
+
struct MobdExt *mobd_create(void)
{
struct MobdExt *data = NULL;
diff --git a/src/emap/data/mobd.h b/src/emap/data/mobd.h
index 0e93890..d887c8f 100644
--- a/src/emap/data/mobd.h
+++ b/src/emap/data/mobd.h
@@ -5,8 +5,10 @@
#define EVOL_MAP_MOBD
struct MobdExt;
+struct mob_db;
struct MobdExt *mobd_get(struct mob_db *md);
+struct MobdExt *mobd_get_by_mob(TBL_MOB *md);
struct MobdExt *mobd_create(void);
#endif // EVOL_MAP_MOBD
diff --git a/src/emap/map.c b/src/emap/map.c
index 7723d4f..f47d929 100644
--- a/src/emap/map.c
+++ b/src/emap/map.c
@@ -22,9 +22,11 @@
#include "emap/permission.h"
#include "emap/send.h"
#include "emap/data/itemd.h"
+#include "emap/data/mobd.h"
#include "emap/data/npcd.h"
#include "emap/data/session.h"
#include "emap/struct/itemdext.h"
+#include "emap/struct/mobdext.h"
#include "emap/struct/npcdext.h"
#include "emap/struct/sessionext.h"
@@ -181,6 +183,13 @@ static int getWalkMask(const struct block_list *bl)
if (ext)
walkMask = ext->walkMask;
}
+ else if (bl->type == BL_MOB)
+ {
+ TBL_MOB *md = (TBL_MOB*)bl;
+ struct MobdExt *ext = mobd_get_by_mob(md);
+ if (ext)
+ walkMask = ext->walkMask;
+ }
return walkMask;
}