]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
we changed the prefix... there too
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index f44bd6295f8bd35f409f31519caf857041286619..d9ced65102578238e8f0a8f4aab38ccce36f49b2 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -825,6 +825,16 @@ static int qc_strcmp(qc_program *prog)
     return 0;
 }
 
+static int qc_floor(qc_program *prog)
+{
+    qcany *num, out;
+    CheckArgs(1);
+    num = GetArg(0);
+    out._float = floor(num->_float);
+    Return(out);
+    return 0;
+}
+
 static prog_builtin qc_builtins[] = {
     NULL,
     &qc_print,       /*   1   */
@@ -839,7 +849,8 @@ static prog_builtin qc_builtins[] = {
     &qc_strcat,      /*   10  */
     &qc_strcmp,      /*   11  */
     &qc_normalize,   /*   12  */
-    &qc_sqrt         /*   13  */
+    &qc_sqrt,        /*   13  */
+    &qc_floor        /*   14  */
 };
 static size_t qc_builtins_count = sizeof(qc_builtins) / sizeof(qc_builtins[0]);