It looks like the ZScript VM cannot recursively return multiple values from a function that returns multiple values. For example, switching to the next or previous weapon while there is a pending weapon does not work as expected. The real issue seems to be in zscript/shared/player.txt on line 1927.
Apparently, this works properly:
Code: Select all
if (player.PendingWeapon != WP_NOCHANGE)
{
bool found;
int slot;
int index;
[found, slot, index] = player.weapons.LocateWeapon(player.PendingWeapon.GetClass());
return found, slot, index;
}
But this code, which is currently being used, does not:
Code: Select all
if (player.PendingWeapon != WP_NOCHANGE)
{
return player.weapons.LocateWeapon(player.PendingWeapon.GetClass());
}
Note that I am NOT using the JIT compiler, as I don't quite trust it to be stable enough for everyday use yet.