diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-28 12:55:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-28 12:55:55 +0300 |
commit | b3bed3c6c764cae9706be429ea0222cad38e2e43 (patch) | |
tree | d8dbdd8595fd1c42f3e388385b0430b0a40fb8a1 /src/map/scriptdefines.h | |
parent | 833e59fee3e6538863ef7277d7b679fb9f2fe750 (diff) | |
download | evol-hercules-b3bed3c6c764cae9706be429ea0222cad38e2e43.tar.gz evol-hercules-b3bed3c6c764cae9706be429ea0222cad38e2e43.tar.bz2 evol-hercules-b3bed3c6c764cae9706be429ea0222cad38e2e43.tar.xz evol-hercules-b3bed3c6c764cae9706be429ea0222cad38e2e43.zip |
add map mask and script functions for manipulate with it.
New script functions:
setmapmask - set new map mask.
addmapmask - add new map mask to current mask.
removemapmask - remove new mask from current mask.
getmapmask - return current map mask.
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) \ |