From a9cb38dbcffcb9de09c936f573b9c0f50e6e386c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 5 Jan 2015 21:54:31 +0000 Subject: [PATCH] game.c: revert changes of r4861 ("consult g_mirrorCount instead of gotpic[]"). git-svn-id: https://svn.eduke32.com/eduke32@4879 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index efa892746..496995b91 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4245,12 +4245,20 @@ static void G_SE40(int32_t smoothratio) void G_HandleMirror(int32_t x, int32_t y, int32_t z, int32_t a, int32_t horiz, int32_t smoothratio) { - if (g_mirrorCount > 0 + if ((gotpic[MIRROR>>3]&(1<<(MIRROR&7))) #ifdef POLYMER && (getrendermode() != REND_POLYMER) #endif ) { + if (g_mirrorCount == 0) + { + // NOTE: We can have g_mirrorCount==0 but gotpic'd MIRROR, + // for example in LNGA2. + gotpic[MIRROR>>3] &= ~(1<<(MIRROR&7)); + return; + } + int32_t i = 0, dst = INT32_MAX; for (int32_t k=g_mirrorCount-1; k>=0; k--)