]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
vtos builtin
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 13:03:49 +0000 (15:03 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 13:03:49 +0000 (15:03 +0200)
exec.c

diff --git a/exec.c b/exec.c
index 3f655bb7384292cd13dfc8a1302606ef771843e7..75202575dc0b6f03342fc0488f5f722d5ee5442f 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -661,6 +661,19 @@ static int qc_ftos(qc_program *prog)
     return 0;
 }
 
+static int qc_vtos(qc_program *prog)
+{
+    char buffer[512];
+    qcany *num;
+    qcany str;
+    CheckArgs(1);
+    num = GetArg(0);
+    snprintf(buffer, sizeof(buffer), "%g %g %g", num->vector[0], num->vector[1], num->vector[2]);
+    str.string = prog_tempstring(prog, buffer);
+    Return(str);
+    return 0;
+}
+
 static int qc_spawn(qc_program *prog)
 {
     qcany ent;
@@ -684,7 +697,8 @@ static prog_builtin qc_builtins[] = {
     &qc_print,
     &qc_ftos,
     &qc_spawn,
-    &qc_kill
+    &qc_kill,
+    &qc_vtos,
 };
 static size_t qc_builtins_count = sizeof(qc_builtins) / sizeof(qc_builtins[0]);