diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-23 19:12:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-23 19:12:10 +0300 |
commit | bf50409735647a80a7145def628822d5235ea753 (patch) | |
tree | 8c3a7007dacc1b40b5d09e7948597132d72e11c8 /src | |
parent | db2c1615ba8b2a679b81eec2c93d9d68e2c5edf8 (diff) | |
download | plugin-bf50409735647a80a7145def628822d5235ea753.tar.gz plugin-bf50409735647a80a7145def628822d5235ea753.tar.bz2 plugin-bf50409735647a80a7145def628822d5235ea753.tar.xz plugin-bf50409735647a80a7145def628822d5235ea753.zip |
Impliment rif script command.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/init.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 27 | ||||
-rw-r--r-- | src/map/script.h | 1 |
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 |