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,8 +1977,9 @@ ACTOR_STATIC void G_MoveStandables(void)
t[1] = s->ang; t[1] = s->ang;
k = A_IncurDamage(i); k = A_IncurDamage(i);
if (k < 0)
goto crack_default;
if (k >= 0)
switch (DYNAMICTILEMAP(k)) switch (DYNAMICTILEMAP(k))
{ {
case FIREEXT__STATIC: case FIREEXT__STATIC:
@ -1995,6 +1996,7 @@ ACTOR_STATIC void G_MoveStandables(void)
goto DETONATE; goto DETONATE;
crack_default:
default: default:
s->cstat = t[0]; s->cstat = t[0];
s->ang = t[1]; s->ang = t[1];

View file

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