summaryrefslogtreecommitdiff
path: root/src/emap/scriptdefines.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-29 00:20:54 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-29 00:20:54 +0300
commit3d76d08ce39ea9f4d4d4e0f015eec74ec6653cd3 (patch)
treeb34f85e2caac7ebc7ba7d92796e1d8de13e1228f /src/emap/scriptdefines.h
parent28fce75298ef95d380e5c9206a26145561933664 (diff)
downloadplugin-3d76d08ce39ea9f4d4d4e0f015eec74ec6653cd3.tar.gz
plugin-3d76d08ce39ea9f4d4d4e0f015eec74ec6653cd3.tar.bz2
plugin-3d76d08ce39ea9f4d4d4e0f015eec74ec6653cd3.tar.xz
plugin-3d76d08ce39ea9f4d4d4e0f015eec74ec6653cd3.zip
Change script function requestitemsindex to return value.
Diffstat (limited to 'src/emap/scriptdefines.h')
-rw-r--r--src/emap/scriptdefines.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/emap/scriptdefines.h b/src/emap/scriptdefines.h
index 5d462f4..274f8f4 100644
--- a/src/emap/scriptdefines.h
+++ b/src/emap/scriptdefines.h
@@ -22,6 +22,24 @@
} \
struct SessionExt *data = session_get(sd->fd)
+#define getSessionDataReturnS(data, def) \
+ if (!st->rid) \
+ { \
+ ShowWarning("!st->rid\n"); \
+ script->reportsrc(st); \
+ script_pushstr(st, aStrdup(def)); \
+ return false; \
+ } \
+ TBL_PC *sd = script->rid2sd(st); \
+ if (!sd) \
+ { \
+ ShowWarning("player not attached\n"); \
+ script->reportsrc(st); \
+ script_pushstr(st, aStrdup(def)); \
+ return false; \
+ } \
+ struct SessionExt *data = session_get(sd->fd)
+
#define getSessionData(data) \
if (!st->rid) \
{ \