fix a silly braino in the resources code that was causing the resource

structs to not get linked into the chain
This commit is contained in:
Bill Currie 2002-04-09 16:06:05 +00:00
parent 9dd7deb798
commit 8588d2d1cd
2 changed files with 4 additions and 1 deletions

View file

@ -42,6 +42,7 @@ static const char rcsid[] =
#include "QF/console.h" #include "QF/console.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/sys.h"
#include "QF/zone.h" #include "QF/zone.h"
typedef struct { typedef struct {
@ -88,11 +89,13 @@ bi_InputLine_Create (progs_t *pr)
break; break;
} }
if (!line) { if (!line) {
Sys_Printf ("out of resources\n");
G_INT (pr, OFS_RETURN) = 0; G_INT (pr, OFS_RETURN) = 0;
return; return;
} }
*line = Con_CreateInputLine (lines, size, prompt); *line = Con_CreateInputLine (lines, size, prompt);
if (!*line) { if (!*line) {
Sys_Printf ("failed to create inputline\n");
G_INT (pr, OFS_RETURN) = 0; G_INT (pr, OFS_RETURN) = 0;
return; return;
} }

View file

@ -81,7 +81,7 @@ PR_Resources_Register (progs_t *pr, const char *name, void *data,
res->data = data; res->data = data;
res->clear = clear; res->clear = clear;
res->next = pr->resources; res->next = pr->resources;
pr->resources = res->next; pr->resources = res;
Hash_Add (pr->resource_hash, res); Hash_Add (pr->resource_hash, res);
} }