diff --git a/source/games/duke/src/_polymost.cpp b/source/games/duke/src/_polymost.cpp index cf7bcf8d2..021ddf42c 100644 --- a/source/games/duke/src/_polymost.cpp +++ b/source/games/duke/src/_polymost.cpp @@ -168,16 +168,16 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho int dst = 0x7fffffff, i = 0; for (int k = 0; k < mirrorcnt; k++) { - int j = abs(wall[mirrorwall[k]].x - cposx) + abs(wall[mirrorwall[k]].y - cposy); + int j = abs(mirrorwall[k]->x - cposx) + abs(mirrorwall[k]->y - cposy); if (j < dst) dst = j, i = k; } - if (wall[mirrorwall[i]].overpicnum == TILE_MIRROR) + if (mirrorwall[i]->overpicnum == TILE_MIRROR) { int tposx, tposy; fixed_t tang; - renderPrepareMirror(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), mirrorwall[i], &tposx, &tposy, &tang); + renderPrepareMirror(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), wallnum(mirrorwall[i]), &tposx, &tposy, &tang); int j = g_visibility; g_visibility = (j >> 1) + (j >> 2); diff --git a/source/games/duke/src/global.cpp b/source/games/duke/src/global.cpp index a7df7869b..bb47058dd 100644 --- a/source/games/duke/src/global.cpp +++ b/source/games/duke/src/global.cpp @@ -116,7 +116,7 @@ int numcyclers; // sector lighting effects Cycler cyclers[MAXCYCLERS]; int mirrorcnt; int mirrorsector[64]; // mirrors -int mirrorwall[64]; +walltype* mirrorwall[64]; int numplayersprites; // player management for some SEs. player_orig po[MAXPLAYERS]; unsigned ambientfx; // used by soundtag and soundtagonce script commands. If exported, export the commands, not the data! diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index b87d5019b..f7b5548a2 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -98,7 +98,7 @@ extern int cloudclock; extern DDukeActor *spriteq[1024]; extern Cycler cyclers[MAXCYCLERS]; extern int mirrorsector[64]; -extern int mirrorwall[64]; +extern walltype* mirrorwall[64]; extern int wupass; extern int chickenplant; diff --git a/source/games/duke/src/premap_d.cpp b/source/games/duke/src/premap_d.cpp index 5e6847a4b..7ac35bc34 100644 --- a/source/games/duke/src/premap_d.cpp +++ b/source/games/duke/src/premap_d.cpp @@ -389,7 +389,7 @@ void prelevel_d(int g) assert(wallnum(&wal) > 0); sectp->ceilingpicnum = MIRROR; sectp->floorpicnum = MIRROR; - mirrorwall[mirrorcnt] = wallnum(&wal); + mirrorwall[mirrorcnt] = &wal; mirrorsector[mirrorcnt] = sectnum(sectp); mirrorcnt++; continue; diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index a01e44ef5..b0a3bb3e7 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -732,7 +732,7 @@ void prelevel_r(int g) { sector[j].ceilingpicnum = MIRROR; sector[j].floorpicnum = MIRROR; - mirrorwall[mirrorcnt] = i; + mirrorwall[mirrorcnt] = wal; mirrorsector[mirrorcnt] = j; mirrorcnt++; continue;