diff options
Diffstat (limited to 'src/map/scriptdefines.h')
-rw-r--r-- | src/map/scriptdefines.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/map/scriptdefines.h b/src/map/scriptdefines.h index 7d2b115..1a6cf14 100644 --- a/src/map/scriptdefines.h +++ b/src/map/scriptdefines.h @@ -4,7 +4,7 @@ #ifndef EVOL_MAP_SCRIPTDEFINES #define EVOL_MAP_SCRIPTDEFINES -#define getDataReturn(def) \ +#define getSessionDataReturn(def) \ if (!st->rid) \ { \ script_pushint(st, def); \ @@ -18,7 +18,7 @@ } \ struct SessionExt *data = session_get(sd->fd) -#define getData() \ +#define getSessionData() \ if (!st->rid) \ return true; \ TBL_PC *sd = script->rid2sd(st); \ @@ -26,6 +26,19 @@ return true; \ struct SessionExt *data = session_get(sd->fd) +#define getMapData(m) \ + struct MapdExt *mapData = mapd_get(m); \ + if (!mapData) \ + return true; + +#define getMapDataReturn(m, def) \ + struct MapdExt *mapData = mapd_get(m); \ + if (!mapData) \ + { \ + script_pushint(st, def); \ + return true; \ + } + #define getSD() \ TBL_PC *sd = script->rid2sd(st); \ if (!sd) \ |