summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/Makefile.in4
-rw-r--r--src/map/script.c16
2 files changed, 18 insertions, 2 deletions
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 931b86c6a..10cf1ed39 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -3,12 +3,12 @@ COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_a
../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \
../common/obj_all/nullpo.o ../common/obj_all/malloc.o ../common/obj_all/showmsg.o \
../common/obj_all/utils.o ../common/obj_all/strlib.o ../common/obj_all/grfio.o \
- ../common/obj_all/mapindex.o ../common/obj_all/ers.o
+ ../common/obj_all/mapindex.o ../common/obj_all/ers.o ../common/obj_all/md5calc.o
COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \
../common/db.h ../common/plugins.h ../common/lock.h \
../common/nullpo.h ../common/malloc.h ../common/showmsg.h \
../common/utils.h ../common/strlib.h ../common/grfio.h \
- ../common/mapindex.h ../common/ers.h
+ ../common/mapindex.h ../common/ers.h ../common/md5calc.h
COMMON_SQL_OBJ = ../common/obj_sql/sql.o
COMMON_SQL_H = ../common/sql.h
diff --git a/src/map/script.c b/src/map/script.c
index 0bd5bbb35..a29b08423 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9,6 +9,7 @@
#include "../common/cbasetypes.h"
#include "../common/malloc.h"
+#include "../common/md5calc.h"
#include "../common/lock.h"
#include "../common/nullpo.h"
#include "../common/showmsg.h"
@@ -11900,6 +11901,7 @@ BUILDIN_FUNC(pow)
script_pushint(st,(int)i);
return 0;
}
+
BUILDIN_FUNC(distance)
{
int x0, y0, x1, y1;
@@ -11914,6 +11916,19 @@ BUILDIN_FUNC(distance)
}
// <--- [zBuffer] List of mathematics commands
+
+BUILDIN_FUNC(md5)
+{
+ const char *tmpstr;
+ char *md5str;
+
+ tmpstr = script_getstr(st,2);
+ md5str = (char *)aMallocA((32+1)*sizeof(char));
+ MD5_String(tmpstr, md5str);
+ script_pushstr(st, md5str);
+ return 0;
+}
+
// [zBuffer] List of dynamic var commands --->
BUILDIN_FUNC(setd)
@@ -13900,6 +13915,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(pow,"ii"),
BUILDIN_DEF(distance,"iiii"),
// <--- [zBuffer] List of mathematics commands
+ BUILDIN_DEF(md5,"s"),
// [zBuffer] List of dynamic var commands --->
BUILDIN_DEF(getd,"*"),
BUILDIN_DEF(setd,"*"),