Tweak r3681 to obtain the same behavior in the pre-r3681 undefined behavior case.

That is, assume that switch(DYNAMICTILEMAP(-1)) (which is an oob access and thus
undefined behavior) gets us to the 'default:' label.

git-svn-id: https://svn.eduke32.com/eduke32@3743 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-05-10 12:31:33 +00:00
parent e627f09787
commit 8dd73d0fe8
2 changed files with 26 additions and 24 deletions

View file

@ -1977,31 +1977,33 @@ ACTOR_STATIC void G_MoveStandables(void)
t[1] = s->ang;
k = A_IncurDamage(i);
if (k < 0)
goto crack_default;
if (k >= 0)
switch (DYNAMICTILEMAP(k))
switch (DYNAMICTILEMAP(k))
{
case FIREEXT__STATIC:
case RPG__STATIC:
case RADIUSEXPLOSION__STATIC:
case SEENINE__STATIC:
case OOZFILTER__STATIC:
for (SPRITES_OF(STAT_STANDABLE, j))
{
case FIREEXT__STATIC:
case RPG__STATIC:
case RADIUSEXPLOSION__STATIC:
case SEENINE__STATIC:
case OOZFILTER__STATIC:
for (SPRITES_OF(STAT_STANDABLE, j))
{
if (s->hitag == sprite[j].hitag && (sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE))
if (sprite[j].shade != -32)
sprite[j].shade = -32;
}
goto DETONATE;
default:
s->cstat = t[0];
s->ang = t[1];
s->extra = 0;
goto BOLT;
if (s->hitag == sprite[j].hitag && (sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE))
if (sprite[j].shade != -32)
sprite[j].shade = -32;
}
goto DETONATE;
crack_default:
default:
s->cstat = t[0];
s->ang = t[1];
s->extra = 0;
goto BOLT;
}
}
goto BOLT;
}

View file

@ -224,8 +224,8 @@ enum sflags_t {
SPRITE_DIDNOSE7WATER = 0x00080000, // used temporarily
};
// custom projectiles
// KEEPINSYNC lunatic/con_lang.lua
// Custom projectiles "workslike" flags.
// XXX: Currently not predefined from CON.
enum pflags_t {
PROJECTILE_HITSCAN = 0x00000001,
PROJECTILE_RPG = 0x00000002,