Skip to content
Snippets Groups Projects

Don't error when checking patch.valid on invalid patches

Merged colette requested to merge fickleheart/SRB2:patch-valid into next
1 file
+ 7
3
Compare changes
  • Side-by-side
  • Inline
+ 7
3
@@ -268,10 +268,14 @@ static int patch_get(lua_State *L)
#endif
enum patch field = luaL_checkoption(L, 2, NULL, patch_opt);
// patches are CURRENTLY always valid, expected to be cached with PU_STATIC
// this may change in the future, so patch.valid still exists
if (!patch)
// patches are invalidated when switching renderers
if (!patch) {
if (field == patch_valid) {
lua_pushboolean(L, 0);
return 1;
}
return LUA_ErrInvalid(L, "patch_t");
}
switch (field)
{
Loading