diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 0935f56de..8ec277189 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -511,9 +511,8 @@ static int mobj_set(lua_State *L) for (i = 0; i < numskins; i++) if (fastcmp(skins[i].name, skin)) { - if (mo->player && !R_SkinUnlock(mo->player-players, i)) - return luaL_error(L, "mobj.skin '%s' not found!", skin); - mo->skin = &skins[i]; + if (!mo->player || R_SkinUnlock(mo->player-players, i)) + mo->skin = &skins[i]; return 0; } return luaL_error(L, "mobj.skin '%s' not found!", skin);