Skip to content
Snippets Groups Projects
Commit 2019e7df authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Throw warning on invalid translations

parent b6e47710
No related branches found
No related tags found
No related merge requests found
......@@ -710,9 +710,14 @@ static int mobj_set(lua_State *L)
}
case mobj_translation:
{
int id = R_FindCustomTranslation(luaL_checkstring(L, 3));
if (!lua_isnil(L, 3)) {
const char *tr = luaL_checkstring(L, 3);
int id = R_FindCustomTranslation(tr);
if (id != -1)
mo->translation = id;
else
return luaL_error(L, "invalid translation '%s'.", tr);
}
else
mo->translation = 0;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment