From be5ca1a4fb83e618bb6046a913e4d8334a13f976 Mon Sep 17 00:00:00 2001
From: Logan Aerl Arias <logana@srb2.org>
Date: Sun, 7 Jan 2024 22:13:09 +0000
Subject: [PATCH] lua_infolib.c: replace lua_objlen with luaL_getn in setRamp()

---
 src/lua_infolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lua_infolib.c b/src/lua_infolib.c
index a9dc32d322..4470c5efcd 100644
--- a/src/lua_infolib.c
+++ b/src/lua_infolib.c
@@ -1662,7 +1662,7 @@ static void setRamp(lua_State *L, skincolor_t* c) {
 	lua_pushnil(L);
 	for (i=0; i<COLORRAMPSIZE; i++) {
 		if (lua_objlen(L,-2)!=COLORRAMPSIZE) {
-			luaL_error(L, LUA_QL("skincolor_t") " field 'ramp' must be %d entries long; got %d.", COLORRAMPSIZE, lua_objlen(L,-2));
+			luaL_error(L, LUA_QL("skincolor_t") " field 'ramp' must be %d entries long; got %d.", COLORRAMPSIZE, luaL_getn(L,-2));
 			break;
 		}
 		if (lua_next(L, -2) != 0) {
-- 
GitLab