summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/init.c2
-rw-r--r--src/map/script.c27
-rw-r--r--src/map/script.h1
3 files changed, 29 insertions, 1 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 901c964..bc64e32 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -74,7 +74,7 @@ HPExport void plugin_init (void)
addScriptCommand("setq", "ii", setq);
addScriptCommand("getnpcdir", "*", getNpcDir);
addScriptCommand("setnpcdir", "*", setNpcDir);
- addScriptCommand("rif", "is*", dummyStr);
+ addScriptCommand("rif", "is*", rif);
addScriptCommand("countitemcolor", "*", dummyInt);
addScriptCommandDeprecated("getclientversion", "", getClientVersion);
// must be replaced to misceffect
diff --git a/src/map/script.c b/src/map/script.c
index cca62c7..2bc9422 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -355,3 +355,30 @@ BUILDIN(setNpcDir)
return true;
}
+
+BUILDIN(rif)
+{
+ char *str = 0;
+ if (script_getnum(st, 2))
+ {
+ str = script_getstr(st, 3);
+ if (str)
+ script_pushstr(st, aStrdup(str));
+ else
+ script_pushconststr(st, (unsigned char *)"");
+ }
+ else if (script_hasdata(st, 4))
+ {
+ str = script_getstr(st, 4);
+ if (str)
+ script_pushstr(st, aStrdup(str));
+ else
+ script_pushconststr(st, (unsigned char *)"");
+ }
+ else
+ {
+ script_pushconststr(st, (unsigned char *)"");
+ }
+
+ return true;
+}
diff --git a/src/map/script.h b/src/map/script.h
index b9b13db..6fbabc0 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -20,5 +20,6 @@ BUILDIN(getq);
BUILDIN(setq);
BUILDIN(getNpcDir);
BUILDIN(setNpcDir);
+BUILDIN(rif);
#endif // EVOL_MAP_SCRIPT