From ab8ab7b3447e53d0935ae525f589265ba5be3ad6 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 12 Apr 2025 10:22:52 -0700 Subject: [PATCH] more THEMERM and THEMERMFILL Give a little more information if environment variable THEMERM or THEMERMFILL has an invalid value. --- dat/themerms.lua | 11 +++++++++-- src/nhlua.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dat/themerms.lua b/dat/themerms.lua index c7ef49147..7d5a73860 100644 --- a/dat/themerms.lua +++ b/dat/themerms.lua @@ -982,15 +982,22 @@ end function pre_themerooms_generate() local debug_themerm = nh.debug_themerm(false) local debug_fill = nh.debug_themerm(true) + local xtrainfo = "" debug_rm_idx = lookup_by_name(debug_themerm, false) debug_fill_idx = lookup_by_name(debug_fill, true) if debug_themerm ~= nil and debug_rm_idx == nil then + if lookup_by_name(debug_themerm, true) ~= nil then + xtrainfo = "; it is a fill type" + end pline("Warning: themeroom '"..debug_themerm - .."' not found in themerooms", true) + .."' not found in themerooms"..xtrainfo, true) end if debug_fill ~= nil and debug_fill_idx == nil then + if lookup_by_name(debug_fill, false) ~= nil then + xtrainfo = "; it is a room type" + end pline("Warning: themeroom fill '"..debug_fill - .."' not found in themeroom_fills", true) + .."' not found in themeroom_fills"..xtrainfo, true) end end diff --git a/src/nhlua.c b/src/nhlua.c index 10c67494a..b3dfd32ad 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -990,7 +990,7 @@ nhl_get_debug_themerm_name(lua_State *L) lua_pop(L, 1); if (wizard) dbg_themerm = getenv(is_fill ? "THEMERMFILL" : "THEMERM"); - if (!dbg_themerm || strlen(dbg_themerm) == 0) { + if (!dbg_themerm || !*dbg_themerm) { lua_pushnil(L); } else { lua_pushstring(L, dbg_themerm);