So you are saying I should switch back to x86?
I realize there is no reason really to compile eqemu as 64 bit, it was just that I got the impression that it was the supported platform. I've even seen people asking about what the "last" 32 bit version was.
I thought EQEmu had switched over to 64 bit since all the download links for the dependencies where pointing to 64 bit versions. (MySql, Perl, LuaJit)
Perl 5.16.3 x64 is the one that the "Ground up Windows" on the wiki linked to. And getting hold of the older versions seems kinda difficult. I couldn't find them on ActivePerl's site at least.
I changed the function into:
Code:
XS(XS__ChooseRandom);
XS(XS__ChooseRandom) {
dXSARGS;
if (items < 1)
Perl_croak(aTHX_ "Usage: quest::ChooseRandom(option1, option2, option3, option4, option5...[no limit])");
int index = zone->random.Int(0, items - 1);
if(index >= items) index = items - 1;
XSprePUSH;
PUSHs(ST(index));
XSRETURN(1);
}
(Yes, I do realize that the "if(index >= item)..." will make it generate bad random. It was just to test if that was the reason for the crash)
I changed the code from manipulating the perl stack directly into pushing the return value on to the stack with the perl api first because I thought it had something to do with that first. But it was the check for index >= items that "fixed" the crash.
The perl script I've been testing with is tutorialb/Vahlara.pl so the line that crashes zone.exe is:
Code:
quest::summonitem(quest::ChooseRandom(54217,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228));