From 853afa30df355171810eb0b5c37a7e61e2f2f6df Mon Sep 17 00:00:00 2001
From: Hanicef <gustaf@hanicef.me>
Date: Sat, 2 Mar 2024 18:51:56 +0100
Subject: [PATCH] Fix missing HUD item for Lua

---
 src/doomdef.h    | 2 ++
 src/lua_hudlib.c | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/src/doomdef.h b/src/doomdef.h
index 60e7dc2031..d1ad93fcc7 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -82,6 +82,7 @@
 #include "version.h"
 #include "doomtype.h"
 
+#include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -648,6 +649,7 @@ UINT32 quickncasehash (const char *p, size_t n)
 #else
 #define I_Assert(e) ((void)0)
 #endif
+#define I_StaticAssert(e) static_assert(e)
 
 // The character that separates pathnames. Forward slash on
 // most systems, but reverse solidus (\) on Windows.
diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c
index d665212636..08e0367f9e 100644
--- a/src/lua_hudlib.c
+++ b/src/lua_hudlib.c
@@ -47,6 +47,7 @@ static const char *const hud_disable_options[] = {
 	"time",
 	"rings",
 	"lives",
+	"input",
 
 	"weaponrings",
 	"powerstones",
@@ -70,6 +71,10 @@ static const char *const hud_disable_options[] = {
 	"intermissionemeralds",
 	NULL};
 
+// you know, let's actually make sure that the table is synced.
+// because fuck knows how many times this has happened at this point. :v
+I_StaticAssert(sizeof(hud_disable_options) / sizeof(*hud_disable_options) == hud_MAX+1);
+
 enum hudinfo {
 	hudinfo_x = 0,
 	hudinfo_y,
-- 
GitLab