From 023c09ccda72f015502146814aacc7a5558875f4 Mon Sep 17 00:00:00 2001
From: Ashnal <ashnal52@gmail.com>
Date: Sat, 6 Apr 2024 23:32:03 -0400
Subject: [PATCH] Fix mismatched Lua lookup array for karthud constants

---
 src/deh_lua.c    |  2 +-
 src/deh_tables.c | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/deh_lua.c b/src/deh_lua.c
index 3a42982925..6c97cda93d 100644
--- a/src/deh_lua.c
+++ b/src/deh_lua.c
@@ -545,7 +545,7 @@ static inline int lib_getenum(lua_State *L)
 				lua_pushinteger(L, i);
 				return 1;
 			}
-		return 0;
+		return luaL_error(L, "karthud '%s' could not be found.\n", word);
 	}
 	else if (mathlib && fastncmp("KHUD_",word,5)) { // SOCs are ALL CAPS!
 		p = word+5;
diff --git a/src/deh_tables.c b/src/deh_tables.c
index 844e0efeb3..3122a13871 100644
--- a/src/deh_tables.c
+++ b/src/deh_tables.c
@@ -4399,26 +4399,25 @@ const char *COLOR_ENUMS[] = {
 const char *const KARTHUD_LIST[] = {
 	"ITEMBLINK",
 	"ITEMBLINKMODE",
-
+	"ROULETTEOFFSET",
 	"RINGFRAME",
 	"RINGTICS",
 	"RINGDELAY",
-	"RINGSPBBLOCK",
-
+	"RINGSPBLOCK",
 	"LAPANIMATION",
 	"LAPHAND",
-
+	"FINISH",
 	"FAULT",
-
 	"BOOSTCAM",
 	"DESTBOOSTCAM",
 	"TIMEOVERCAM",
-
+	"AIRCAM",
 	"ENGINESND",
 	"VOICES",
 	"TAUNTVOICES",
-
+	"TAUNTHORNS",
 	"YOUGOTEM",
+	"TRICKCOOL"
 };
 
 const char *const HUDITEMS_LIST[] = {
-- 
GitLab