mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Fix oob accesses when e.g. shooting tile -1. (can propagate via WEAPONx_SHOOTS)
Ideally, we would also warn when setting WEAPONx_SHOOTS to negative values, but we'd have to intercept CON's setvar's and it wouldn't be pretty. git-svn-id: https://svn.eduke32.com/eduke32@2268 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a61052f807
commit
ca2d612976
3 changed files with 25 additions and 21 deletions
|
@ -334,7 +334,8 @@ extern char forcegl;
|
|||
#define gametextpal(x,y,t,s,p) G_PrintGameText(0,STARTALPHANUM, x,y,t,s,p,26,0, 0, xdim-1, ydim-1, 65536)
|
||||
#define gametextpalbits(x,y,t,s,p,dabits) G_PrintGameText(0,STARTALPHANUM, x,y,t,s,p,dabits,0, 0, xdim-1, ydim-1, 65536)
|
||||
#define A_CheckSpriteFlags(iActor, iType) (((SpriteFlags[sprite[iActor].picnum]^actor[iActor].flags) & iType) != 0)
|
||||
#define A_CheckSpriteTileFlags(iPicnum, iType) ((SpriteFlags[iPicnum] & iType) != 0)
|
||||
// (unsigned)iPicnum check: AMC TC Rusty Nails, bayonet MG alt. fire, iPicnum == -1 (via aplWeaponShoots)
|
||||
#define A_CheckSpriteTileFlags(iPicnum, iType) (((unsigned)iPicnum < MAXTILES) && (SpriteFlags[iPicnum] & iType) != 0)
|
||||
#define G_EnterText(x, y, t, dalen, c) _EnterText(0,x,y,t,dalen,c)
|
||||
#define Net_EnterText(x, y, t, dalen, c) _EnterText(1,x,y,t,dalen,c)
|
||||
#define S_StopSound(num) S_StopEnvSound(num, -1)
|
||||
|
|
|
@ -932,6 +932,8 @@ void Gv_ResetSystemDefaults(void)
|
|||
aplWeaponFlags[i][j]=Gv_GetVarByLabel(aszBuf,0, -1, j);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",i);
|
||||
aplWeaponShoots[i][j]=Gv_GetVarByLabel(aszBuf,0, -1, j);
|
||||
if ((unsigned)aplWeaponShoots[i][j] >= MAXTILES)
|
||||
aplWeaponShoots[i][j] = 0;
|
||||
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",i);
|
||||
aplWeaponSpawnTime[i][j]=Gv_GetVarByLabel(aszBuf,0, -1, j);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SPAWN",i);
|
||||
|
|
|
@ -346,26 +346,27 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
|
|||
}
|
||||
|
||||
#ifdef POLYMER
|
||||
switch (DynamicTileMap[atwith])
|
||||
{
|
||||
case FIRELASER__STATIC:
|
||||
case SHOTGUN__STATIC:
|
||||
case SHOTSPARK1__STATIC:
|
||||
case CHAINGUN__STATIC:
|
||||
case RPG__STATIC:
|
||||
case MORTER__STATIC:
|
||||
{
|
||||
int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7);
|
||||
s-> x += x;
|
||||
s-> y += y;
|
||||
G_AddGameLight(0, i, PHEIGHT, 8192, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
actor[i].lightcount = 2;
|
||||
s-> x -= x;
|
||||
s-> y -= y;
|
||||
}
|
||||
if (atwith >= 0)
|
||||
switch (DynamicTileMap[atwith])
|
||||
{
|
||||
case FIRELASER__STATIC:
|
||||
case SHOTGUN__STATIC:
|
||||
case SHOTSPARK1__STATIC:
|
||||
case CHAINGUN__STATIC:
|
||||
case RPG__STATIC:
|
||||
case MORTER__STATIC:
|
||||
{
|
||||
int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7);
|
||||
s-> x += x;
|
||||
s-> y += y;
|
||||
G_AddGameLight(0, i, PHEIGHT, 8192, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
actor[i].lightcount = 2;
|
||||
s-> x -= x;
|
||||
s-> y -= y;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // POLYMER
|
||||
}
|
||||
|
||||
|
@ -1044,7 +1045,7 @@ DOSKIPBULLETHOLE:
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
else if (atwith >= 0)
|
||||
{
|
||||
switch (DynamicTileMap[atwith])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue