Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix HTTP API not being available in async mainmenu (#10086)
  • Loading branch information
rubenwardy committed Jun 22, 2020
1 parent e99415e commit 4cb18d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/script/lua_api/l_http.cpp
Expand Up @@ -230,3 +230,10 @@ void ModApiHttp::Initialize(lua_State *L, int top)

#endif
}

void ModApiHttp::InitializeAsync(lua_State *L, int top)
{
#if USE_CURL
API_FCT(get_http_api);
#endif
}
1 change: 1 addition & 0 deletions src/script/lua_api/l_http.h
Expand Up @@ -50,4 +50,5 @@ class ModApiHttp : public ModApiBase {

public:
static void Initialize(lua_State *L, int top);
static void InitializeAsync(lua_State *L, int top);
};
1 change: 1 addition & 0 deletions src/script/scripting_mainmenu.cpp
Expand Up @@ -73,6 +73,7 @@ void MainMenuScripting::initializeModApi(lua_State *L, int top)
asyncEngine.registerStateInitializer(registerLuaClasses);
asyncEngine.registerStateInitializer(ModApiMainMenu::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiUtil::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiHttp::InitializeAsync);

// Initialize async environment
//TODO possibly make number of async threads configurable
Expand Down

0 comments on commit 4cb18d4

Please sign in to comment.