Oops, make 'return' GIB builtin actually end the current function.

This commit is contained in:
Brian Koropoff 2003-03-01 02:44:58 +00:00
parent 90752b33fe
commit 2be8a851d5
3 changed files with 5 additions and 3 deletions

View file

@ -48,7 +48,7 @@ typedef struct gib_buffer_data_s {
struct gib_script_s *script;
struct gib_tree_s *program, *ip;
struct dstring_s *arg_composite;
qboolean done, waitret;
qboolean waitret;
struct gib_sstack_s {
struct gib_dsarray_s {
struct dstring_s **dstrs;

View file

@ -104,7 +104,7 @@ GIB_Buffer_Reset (struct cbuf_s *cbuf)
g->script = 0;
g->program = g->ip = 0;
g->stack.p = 0;
g->waitret = g->done = false;
g->waitret = false;
}

View file

@ -278,12 +278,14 @@ GIB_Domain_Clear_f (void)
Hash_FlushTable (GIB_Domain_Get (GIB_Argv (2)));
}
static gib_tree_t fakeip = {0,0,0,0,0,0,0,0};
static void
GIB_Return_f (void)
{
cbuf_t *sp = cbuf_active->up;
GIB_DATA (cbuf_active)->done = true;
GIB_DATA (cbuf_active)->ip = &fakeip;
if (GIB_Argc () > 1 && sp && sp->interpreter == &gib_interp
&& GIB_DATA (sp)->waitret) {