mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-01 06:00:45 +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:
|
||||
{
|
||||
int id = R_FindCustomTranslation(luaL_checkstring(L, 3));
|
||||
if (id != -1)
|
||||
mo->translation = id;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue