Skip to content

Commit

Permalink
checkSettingSecurity: use script api type check for both cases
Browse files Browse the repository at this point in the history
note: this means async mainmenu env no longer get the privilege
  • Loading branch information
grorp committed Jan 16, 2025
1 parent 76685b8 commit 0bec1df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/lua_api/l_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ static inline int checkSettingSecurity(lua_State* L, const std::string &name)
{
#if CHECK_CLIENT_BUILD()
// Main menu and pause menu are allowed everything
if (ModApiBase::getGuiEngine(L) ||
ModApiBase::getScriptApiBase(L)->getType() == ScriptingType::PauseMenu)
auto context = ModApiBase::getScriptApiBase(L)->getType();
if (context == ScriptingType::MainMenu || context == ScriptingType::PauseMenu)
return 0;
#endif

Expand Down

0 comments on commit 0bec1df

Please sign in to comment.