mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-05 08:51:19 +00:00
Throw warning on invalid translations
This commit is contained in:
parent
b6e4771085
commit
2019e7df18
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue