From 1edc6b736d19d39b4f246c816267eef4aa0618bd Mon Sep 17 00:00:00 2001 From: NepDisk Date: Thu, 11 Sep 2025 10:33:03 -0400 Subject: [PATCH] Fix Colormap compat --- src/lua_hudlib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 15b5be728..694dd79bf 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -1128,10 +1128,8 @@ static int libd_getColormap(lua_State *L) { if (skinnum >= MAXSKINS) return luaL_error(L, "skin number %d is out of range (>%d)", skinnum, MAXSKINS-1); - else if (skinnum < TC_BOSS && skinnum > MAXSKINS) - { - return luaL_error(L, "skin number %d is out of range (%d - %d)", skinnum, TC_BOSS, MAXSKINS-1); - } + else if (skinnum < -6 && !(skinnum >= TC_BOSS && skinnum <= TC_DEFAULT)) + return luaL_error(L, "translation colormap index is out of range"); switch(skinnum) {