mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Fix "setvarvar: Gv_GetVarX(): invalid player ID -1" message for certain userdef accesses
git-svn-id: https://svn.eduke32.com/eduke32@6717 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
478165f00c
commit
ab3c4366e4
1 changed files with 3 additions and 2 deletions
|
@ -876,10 +876,11 @@ int __fastcall Gv_GetSpecialVarX(int gameVar)
|
|||
else if (gameVar & (MAXGAMEVARS << 3)) // struct shortcut vars
|
||||
{
|
||||
int arrayIndexVar = *insptr++;
|
||||
int arrayIndex = Gv_GetVarX(arrayIndexVar);
|
||||
auto const structIndex = (gameVar & (MAXGAMEVARS - 1)) - g_structVarIDs;
|
||||
int arrayIndex = structIndex != STRUCT_USERDEF ? Gv_GetVarX(arrayIndexVar) : -1;
|
||||
int const labelNum = *insptr++;
|
||||
|
||||
switch ((gameVar & (MAXGAMEVARS - 1)) - g_structVarIDs)
|
||||
switch (structIndex)
|
||||
{
|
||||
case STRUCT_SPRITE:
|
||||
arrayIndexVar = (EDUKE32_PREDICT_FALSE(ActorLabels[labelNum].flags & LABEL_HASPARM2)) ? Gv_GetVarX(*insptr++) : 0;
|
||||
|
|
Loading…
Reference in a new issue