From 6a43aac0d5b9ba60f1a60c33e1f98488fdccb863 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Mon, 17 Mar 2025 23:00:56 +0100 Subject: [PATCH] Fix the Lua Linedef Flags conundrum --- src/deh_lua.c | 31 +++---------------------------- src/deh_tables.c | 27 ++++++++++++++++++++++----- src/deh_tables.h | 1 + src/doomdata.h | 5 ----- 4 files changed, 26 insertions(+), 38 deletions(-) diff --git a/src/deh_lua.c b/src/deh_lua.c index 887b48338..ead8b5d20 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -362,37 +362,12 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word) } else if (fastncmp("ML_", word, 3)) { p = word+3; - for (i = 0; i < 20; i++) - if (ML_LIST[i] && fastcmp(p, ML_LIST[i])) { + const char *const *list = lua_compatmode ? ML_LIST_KART : ML_LIST; + for (i = 0; list[i]; i++) + if (fastcmp(p, list[i])) { CacheAndPushConstant(L, word, ((lua_Integer)1<