mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 04:01:56 +02:00
Make NOHTTP transparent to the Lua API
Also, HTTPRequest:status would never have returned queued since the request is started immediately on creation.
This commit is contained in:
@@ -153,9 +153,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
|
||||
initFileSystemAPI();
|
||||
initPlatformAPI();
|
||||
initEventAPI();
|
||||
#ifndef NOHTTP
|
||||
initHttpAPI();
|
||||
#endif
|
||||
|
||||
//Old TPT API
|
||||
int currentElementMeta, currentElement;
|
||||
@@ -3726,11 +3724,6 @@ public:
|
||||
return dead || request->CheckDone();
|
||||
}
|
||||
|
||||
bool Running() const
|
||||
{
|
||||
return !dead && request->CheckStarted();
|
||||
}
|
||||
|
||||
void Progress(int *total, int *done)
|
||||
{
|
||||
if (!dead)
|
||||
@@ -3781,13 +3774,9 @@ static int http_request_status(lua_State *l)
|
||||
{
|
||||
lua_pushliteral(l, "done");
|
||||
}
|
||||
else if (rh->Running())
|
||||
{
|
||||
lua_pushliteral(l, "running");
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pushliteral(l, "queued");
|
||||
lua_pushliteral(l, "running");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user