Throw a Lua error when R_Frame2Char is called with a frame number without character representation

This commit is contained in:
LJ Sonic 2024-04-03 20:39:53 +02:00
parent 49fa45039e
commit f406e9bbb5

View file

@ -3030,6 +3030,9 @@ static int lib_rFrame2Char(lua_State *L)
//HUDSAFE
c[0] = R_Frame2Char(ch);
if (c[0] == '\xFF')
return luaL_error(L, "frame %u cannot be represented by a character", ch);
c[1] = 0;
lua_pushstring(L, c);