mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@679 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
eb8fde73b2
commit
67591ce3a3
1 changed files with 9 additions and 8 deletions
|
@ -550,7 +550,10 @@ int GetGameVarID(int id, int iActor, int iPlayer)
|
||||||
if ((index < aGameArrays[id-MAXGAMEVARS-1].size)&&(index>=0))
|
if ((index < aGameArrays[id-MAXGAMEVARS-1].size)&&(index>=0))
|
||||||
inv =aGameArrays[id-MAXGAMEVARS-1].plValues[index];
|
inv =aGameArrays[id-MAXGAMEVARS-1].plValues[index];
|
||||||
else
|
else
|
||||||
gameexit("array");
|
{
|
||||||
|
OSD_Printf("GetGameVarID(): invalid array index (%s[%d])\n",aGameArrays[id-MAXGAMEVARS-1].szLabel,index);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return(inv);
|
return(inv);
|
||||||
}
|
}
|
||||||
if (!(id&(MAXGAMEVARS<<1)))
|
if (!(id&(MAXGAMEVARS<<1)))
|
||||||
|
@ -612,18 +615,17 @@ int GetGameVarID(int id, int iActor, int iPlayer)
|
||||||
if (inv) return(-aGameVars[id].lValue);
|
if (inv) return(-aGameVars[id].lValue);
|
||||||
return (aGameVars[id].lValue);
|
return (aGameVars[id].lValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGameArrayID(int id,int index, int lValue)
|
void SetGameArrayID(int id,int index, int lValue)
|
||||||
{
|
{
|
||||||
if (id<0 || id >= iGameArrayCount)
|
if (id<0 || id >= iGameArrayCount || !((index < aGameArrays[id].size)&&(index>=0)))
|
||||||
{
|
{
|
||||||
OSD_Printf("SetGameVarID(): tried to set invalid gamevar ID (%d) from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
OSD_Printf("SetGameVarID(): tried to set invalid array ID (%d) or index out of bounds from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((index < aGameArrays[id].size)&&(index>=0))
|
aGameArrays[id].plValues[index]=lValue;
|
||||||
aGameArrays[id].plValues[index]=lValue;
|
|
||||||
else
|
|
||||||
gameexit("array1");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
||||||
{
|
{
|
||||||
if (id<0 || id >= iGameVarCount)
|
if (id<0 || id >= iGameVarCount)
|
||||||
|
@ -678,7 +680,6 @@ void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
aGameVars[id].lValue=lValue;
|
aGameVars[id].lValue=lValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue