Skip to content

Commit

Permalink
- Duke: fixed some crashes with bad map setups
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jun 5, 2022
1 parent 126f605 commit bc5c742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/games/duke/src/_polymost.cpp
Expand Up @@ -159,7 +159,7 @@ void se40code(int x, int y, int z, binangle a, fixedhoriz h, int smoothratio)

void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz choriz, int smoothratio)
{
if (testgotpic(TILE_MIRROR, true))
if (mirrorcnt > 0 && testgotpic(TILE_MIRROR, true))
{
int dst = 0x7fffffff, i = 0;
for (int k = 0; k < mirrorcnt; k++)
Expand All @@ -168,7 +168,7 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
if (j < dst) dst = j, i = k;
}

if (mirrorwall[i]->overpicnum == TILE_MIRROR)
if (mirrorwall[i] && mirrorwall[i]->overpicnum == TILE_MIRROR)
{
int tposx, tposy;
fixed_t tang;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/actors_d.cpp
Expand Up @@ -3510,7 +3510,7 @@ void moveeffectors_d(void) //STATNUM 3
auto sc = act->sector();
if (sc->wallnum != 4) continue;
auto wal = sc->firstWall() + 2;
alignflorslope(act->sector(), wal->wall_int_pos().X, wal->wall_int_pos().Y, wal->nextSector()->floorz);
if (wal->nextSector()) alignflorslope(act->sector(), wal->wall_int_pos().X, wal->wall_int_pos().Y, wal->nextSector()->floorz);
}
}

Expand Down

0 comments on commit bc5c742

Please sign in to comment.