From 8588d2d1cd153f728164836e2f051551a2c596e7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 9 Apr 2002 16:06:05 +0000 Subject: [PATCH] fix a silly braino in the resources code that was causing the resource structs to not get linked into the chain --- libs/gamecode/builtins/bi_inputline.c | 3 +++ libs/gamecode/engine/pr_resource.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/gamecode/builtins/bi_inputline.c b/libs/gamecode/builtins/bi_inputline.c index d33c309a3..f36eab91f 100644 --- a/libs/gamecode/builtins/bi_inputline.c +++ b/libs/gamecode/builtins/bi_inputline.c @@ -42,6 +42,7 @@ static const char rcsid[] = #include "QF/console.h" #include "QF/draw.h" #include "QF/progs.h" +#include "QF/sys.h" #include "QF/zone.h" typedef struct { @@ -88,11 +89,13 @@ bi_InputLine_Create (progs_t *pr) break; } if (!line) { + Sys_Printf ("out of resources\n"); G_INT (pr, OFS_RETURN) = 0; return; } *line = Con_CreateInputLine (lines, size, prompt); if (!*line) { + Sys_Printf ("failed to create inputline\n"); G_INT (pr, OFS_RETURN) = 0; return; } diff --git a/libs/gamecode/engine/pr_resource.c b/libs/gamecode/engine/pr_resource.c index 09d194e80..c87598cbc 100644 --- a/libs/gamecode/engine/pr_resource.c +++ b/libs/gamecode/engine/pr_resource.c @@ -81,7 +81,7 @@ PR_Resources_Register (progs_t *pr, const char *name, void *data, res->data = data; res->clear = clear; res->next = pr->resources; - pr->resources = res->next; + pr->resources = res; Hash_Add (pr->resource_hash, res); }