Merge pull request #56 from ineedbots/develop
Register the GSC HTTP functions reguardless of being in Dedicated to prevent Script Compile Error
This commit is contained in:
commit
dc992cfb72
@ -964,10 +964,9 @@ namespace Components
|
|||||||
Download::ScriptDownloads.clear();
|
Download::ScriptDownloads.clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Dedicated::IsEnabled() || Flags::HasFlag("scriptablehttp"))
|
|
||||||
{
|
|
||||||
Script::AddFunction("httpGet", [](Game::scr_entref_t)
|
Script::AddFunction("httpGet", [](Game::scr_entref_t)
|
||||||
{
|
{
|
||||||
|
if (!Dedicated::IsEnabled() && !Flags::HasFlag("scriptablehttp")) return;
|
||||||
if (Game::Scr_GetNumParam() < 1) return;
|
if (Game::Scr_GetNumParam() < 1) return;
|
||||||
|
|
||||||
std::string url = Game::Scr_GetString(0);
|
std::string url = Game::Scr_GetString(0);
|
||||||
@ -981,6 +980,7 @@ namespace Components
|
|||||||
|
|
||||||
Script::AddFunction("httpCancel", [](Game::scr_entref_t)
|
Script::AddFunction("httpCancel", [](Game::scr_entref_t)
|
||||||
{
|
{
|
||||||
|
if (!Dedicated::IsEnabled() && !Flags::HasFlag("scriptablehttp")) return;
|
||||||
if (Game::Scr_GetNumParam() < 1) return;
|
if (Game::Scr_GetNumParam() < 1) return;
|
||||||
|
|
||||||
unsigned int object = Game::Scr_GetObject(0);
|
unsigned int object = Game::Scr_GetObject(0);
|
||||||
@ -994,7 +994,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Download::~Download()
|
Download::~Download()
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@ namespace Components
|
|||||||
static std::vector<std::string> ScriptNameStack;
|
static std::vector<std::string> ScriptNameStack;
|
||||||
static unsigned short FunctionName;
|
static unsigned short FunctionName;
|
||||||
static std::unordered_map<std::string, std::string> ScriptStorage;
|
static std::unordered_map<std::string, std::string> ScriptStorage;
|
||||||
static std::unordered_map<int, std::string> Script::ScriptBaseProgramNum;
|
static std::unordered_map<int, std::string> ScriptBaseProgramNum;
|
||||||
|
|
||||||
static Utils::Signal<Scheduler::Callback> VMShutdownSignal;
|
static Utils::Signal<Scheduler::Callback> VMShutdownSignal;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user