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
2 merge requests!2355fix newer versions of mixerx,!2190ZDoom translations
...@@ -710,9 +710,14 @@ static int mobj_set(lua_State *L) ...@@ -710,9 +710,14 @@ static int mobj_set(lua_State *L)
} }
case mobj_translation: case mobj_translation:
{ {
int id = R_FindCustomTranslation(luaL_checkstring(L, 3)); if (!lua_isnil(L, 3)) {
if (id != -1) const char *tr = luaL_checkstring(L, 3);
mo->translation = id; int id = R_FindCustomTranslation(tr);
if (id != -1)
mo->translation = id;
else
return luaL_error(L, "invalid translation '%s'.", tr);
}
else else
mo->translation = 0; mo->translation = 0;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment