summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-06-01 16:05:05 +0200
committerGitHub <noreply@github.com>2019-06-01 16:05:05 +0200
commit259a790cb0a6fa17a346fc30ca61ce6f1a085d3e (patch)
tree3f4eeaf3dae03d64cd43727a59d150b0d8222271 /src
parent9154e3c3cde864e7c08f6df3cda28772e268f2e6 (diff)
parent1f9c83ef453741b7029b5706c7cd52edc7ce9039 (diff)
downloadhercules-259a790cb0a6fa17a346fc30ca61ce6f1a085d3e.tar.gz
hercules-259a790cb0a6fa17a346fc30ca61ce6f1a085d3e.tar.bz2
hercules-259a790cb0a6fa17a346fc30ca61ce6f1a085d3e.tar.xz
hercules-259a790cb0a6fa17a346fc30ca61ce6f1a085d3e.zip
Merge pull request #2472 from Emistry/scriptcommand_cap_value
Add *cap_value script command
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 478cc8e1d..1e0cd87ec 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -17784,6 +17784,17 @@ static BUILDIN(max)
return true;
}
+static BUILDIN(cap_value)
+{
+ int value = script_getnum(st, 2);
+ int min = script_getnum(st, 3);
+ int max = script_getnum(st, 4);
+
+ script_pushint(st, (int)cap_value(value, min, max));
+
+ return true;
+}
+
static BUILDIN(md5)
{
const char *tmpstr;
@@ -25801,6 +25812,7 @@ static void script_parse_builtin(void)
// <--- List of mathematics commands
BUILDIN_DEF(min, "i*"),
BUILDIN_DEF(max, "i*"),
+ BUILDIN_DEF(cap_value, "iii"),
BUILDIN_DEF(md5,"s"),
BUILDIN_DEF(swap,"rr"),
// [zBuffer] List of dynamic var commands --->