summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-07 01:22:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-07 01:22:50 +0300
commitb30129688a0e8b6e353447d7af579a6b2c2505c8 (patch)
treecbdeb4f5c6a45b93fbe975fddfcd65df434601d2 /src/map/script.c
parentd808fef992c2f37bd89fd8336f20cf587016e5a9 (diff)
downloadevol-hercules-b30129688a0e8b6e353447d7af579a6b2c2505c8.tar.gz
evol-hercules-b30129688a0e8b6e353447d7af579a6b2c2505c8.tar.bz2
evol-hercules-b30129688a0e8b6e353447d7af579a6b2c2505c8.tar.xz
evol-hercules-b30129688a0e8b6e353447d7af579a6b2c2505c8.zip
Impliment script function getlang.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 074e873..8499411 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -17,6 +17,20 @@
#include "map/session.h"
#include "map/sessionext.h"
+#define getData(def) \
+ if (!st->rid) \
+ { \
+ script_pushint(st, 0); \
+ return true; \
+ } \
+ TBL_PC *sd = script->rid2sd(st); \
+ if (!sd) \
+ { \
+ script_pushint(st, 0); \
+ return true; \
+ } \
+ struct SessionExt *data = session_get(sd->fd)
+
BUILDIN(l)
{
// for now not translate and not use format parameters
@@ -26,17 +40,12 @@ BUILDIN(l)
BUILDIN(getClientVersion)
{
- if (!st->rid)
- {
- script_pushint(st, 0);
- return true;
- }
- TBL_PC *sd = script->rid2sd(st);
- if (!sd)
- {
- script_pushint(st, 0);
- return true;
- }
- struct SessionExt *data = session_get(sd->fd);
+ getData(0);
script_pushint(st, data->clientVersion);
}
+
+BUILDIN(getLang)
+{
+ getData(0);
+ script_pushint(st, data->language);
+}