Forgot about these

This commit is contained in:
Diavolo 2022-02-01 13:15:59 +01:00
parent 12a81eb5f7
commit f79bddb4c3
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 7 additions and 9 deletions

View File

@ -967,11 +967,10 @@ namespace Components
Script::AddFunction("HttpGet", [](Game::scr_entref_t)
{
if (!Dedicated::IsEnabled() && !Flags::HasFlag("scriptablehttp")) return;
if (Game::Scr_GetNumParam() < 1u) return;
std::string url = Game::Scr_GetString(0);
const auto* url = Game::Scr_GetString(0);
if (url.empty())
if (url == nullptr)
{
Game::Scr_ParamError(0, "^1HttpGet: Illegal parameters!\n");
return;
@ -985,13 +984,12 @@ namespace Components
Game::RemoveRefToObject(object);
});
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() < 1u) return;
unsigned int object = Game::Scr_GetObject(0);
for (auto& download : Download::ScriptDownloads)
const auto object = Game::Scr_GetObject(0);
for (const auto& download : Download::ScriptDownloads)
{
if (object == download->getObject())
{

View File

@ -780,11 +780,11 @@ namespace Components
{
int dlc = token.get<int>();
for (auto pack : Maps::DlcPacks)
for (const auto& pack : Maps::DlcPacks)
{
if (pack.index == dlc)
{
ShellExecute(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW);
ShellExecuteW(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW);
return;
}
}