summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 9e72453..074e873 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14,9 +14,29 @@
#include "../../../map/pc.h"
#include "../../../map/script.h"
+#include "map/session.h"
+#include "map/sessionext.h"
+
BUILDIN(l)
{
// for now not translate and not use format parameters
script_pushstr(st, aStrdup(script_getstr(st, 2)));
return true;
}
+
+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);
+ script_pushint(st, data->clientVersion);
+}