From 6896ef650e7feacf4275e8d67f23718877c38965 Mon Sep 17 00:00:00 2001 From: Ali Date: Mon, 25 May 2020 16:18:22 +0300 Subject: [PATCH 1/2] [ci skip] Updated installer to support powershell older than 3.0 --- utils/scripts/eqemu_server.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index 2b9bd4a7a..4c510ff9f 100755 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -705,7 +705,7 @@ sub get_windows_wget { if (!-d "bin") { mkdir("bin"); } - `powershell -Command "\$ProgressPreference = 'SilentlyContinue'; Invoke-RestMethod -ContentType \"application/octet-stream\" -Uri https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/windows/wget.exe -OutFile bin/wget.exe"` + `powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/windows/wget.exe', 'bin\\wget.exe') "` } } From 5e9bf3b044c535273406dd806e84220a2defa001 Mon Sep 17 00:00:00 2001 From: KimLS Date: Mon, 25 May 2020 20:56:49 -0700 Subject: [PATCH 2/2] Make ChooseRandom more idiomatic, the fact that the code can return a SV of anytype makes it a bit dangerous, good canidate for rewriting as a plugin --- zone/embparser_api.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 6b4d75719..83839457b 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -1618,11 +1618,12 @@ XS(XS__ChooseRandom) { if (items < 1) Perl_croak(aTHX_ "Usage: quest::ChooseRandom(option1, option2, option3, option4, option5...[no limit])"); + dXSTARG; int index = zone->random.Int(0, items - 1); + SV *RETVAL = ST(index); - SV *tmp = ST(0); - ST(0) = ST(index); - ST(index) = tmp; + XSprePUSH; + PUSHs(RETVAL); XSRETURN(1); //return 1 element from the stack (ST(0)) }