Rename Gv_GetSpecialVar() to Gv_GetArrayOrStruct() and fix what would be a bug in Gv_GetVarDataPtr() if we were using it for something more than the single thing we use it for now

git-svn-id: https://svn.eduke32.com/eduke32@7208 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-11-18 18:12:01 +00:00
parent 23308603c5
commit fb15d84982

View file

@ -613,7 +613,7 @@ int __fastcall Gv_GetArrayValue(int const id, int index)
goto badindex; \
}
static int __fastcall Gv_GetSpecialVar(int gameVar, int spriteNum, int const playerNum)
static int __fastcall Gv_GetArrayOrStruct(int gameVar, int spriteNum, int const playerNum)
{
int returnValue = gameVar;
@ -746,7 +746,7 @@ static FORCE_INLINE int __fastcall Gv_GetVar__(int &gameVar, int &spriteNum, int
else if (gameVar == GV_FLAG_CONSTANT)
returnValue = *insptr++;
else if ((gameVar & ~GV_FLAG_NEGATIVE) >= g_gameVarCount)
returnValue = Gv_GetSpecialVar(gameVar, spriteNum, playerNum);
returnValue = Gv_GetArrayOrStruct(gameVar, spriteNum, playerNum);
else
{
int const invertResult = !!(gameVar & GV_FLAG_NEGATIVE);
@ -854,7 +854,7 @@ static intptr_t *Gv_GetVarDataPtr(const char *szGameLabel)
gamevar_t &var = aGameVars[gameVar];
if (var.flags & (GAMEVAR_PERACTOR | GAMEVAR_PERPLAYER))
if (var.flags & (GAMEVAR_USER_MASK|GAMEVAR_PTR_MASK))
{
if (EDUKE32_PREDICT_FALSE(!var.pValues))
CON_ERRPRINTF("Gv_GetVarDataPtr(): INTERNAL ERROR: NULL array !!!\n");