From 2ebefd7850976ee9fd5f90de8d4630cb0be64538 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 8 May 2022 23:55:57 +0900 Subject: [PATCH] [wad] Return 0 if no wad file is loaded This allows QF to load without a wad file as it will use the internal character definition. --- libs/util/wad.c | 3 +++ ruamoko/qwaq/builtins/graphics.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/util/wad.c b/libs/util/wad.c index ed0749594..017e48605 100644 --- a/libs/util/wad.c +++ b/libs/util/wad.c @@ -127,6 +127,9 @@ W_GetLumpName (const char *name) { lumpinfo_t *lump; + if (!wad_base) { + return 0; + } lump = W_GetLumpinfo (name); return (void *) (wad_base + lump->filepos); diff --git a/ruamoko/qwaq/builtins/graphics.c b/ruamoko/qwaq/builtins/graphics.c index ee9fb8025..709f05b4f 100644 --- a/ruamoko/qwaq/builtins/graphics.c +++ b/ruamoko/qwaq/builtins/graphics.c @@ -326,7 +326,6 @@ BI_Graphics_Init (progs_t *pr) generate_palette (); generate_colormap (); - W_LoadWadFile ("gfx.wad"); VID_Init (default_palette[0], default_colormap); IN_Init (); Mod_Init ();