mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
vtos builtin
This commit is contained in:
parent
d4077f6884
commit
9433f66a00
1 changed files with 15 additions and 1 deletions
16
exec.c
16
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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue