summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt7
-rw-r--r--src/map/script.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index cc49a9c0f..4d8053da0 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -10456,3 +10456,10 @@ Invisible for players, because current implimentation using title id only.
Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
---------------------------------------
+
+*closeroulette()
+
+Force close roulette window.
+Works for 20141008 main clients, 20140903 re, any zero.
+
+---------------------------------------
diff --git a/src/map/script.c b/src/map/script.c
index 80489dfac..4fb24708b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -25275,6 +25275,16 @@ static BUILDIN(getInventorySize)
return true;
}
+// force close roulette window if it opened
+static BUILDIN(closeroulette)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ clif->roulette_close(sd);
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -26026,6 +26036,8 @@ static void script_parse_builtin(void)
BUILDIN_DEF(expandInventoryResult, "i"),
BUILDIN_DEF(expandInventory, "i"),
BUILDIN_DEF(getInventorySize, ""),
+
+ BUILDIN_DEF(closeroulette, ""),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up