From 7ed8f5aec481b498eafc955c9914c57068a9f6e6 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 12 Mar 2020 00:58:18 +0000 Subject: [PATCH] Fix a bug with swinging doors This fixes a bug with swinging doors where multiple swinging doors linked together could become out of sync with each other if you block one door from moving and activate the second door again while the first is still blocked. git-svn-id: https://svn.eduke32.com/eduke32@8721 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/sector.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/duke3d/src/sector.cpp b/source/duke3d/src/sector.cpp index 376944cce..65222f888 100644 --- a/source/duke3d/src/sector.cpp +++ b/source/duke3d/src/sector.cpp @@ -925,11 +925,15 @@ REDODOOR: if (j >= 0) { + for (SPRITES_OF(STAT_EFFECTOR, i)) + if (tag == (sector[SECT(i)].lotag & 0x8000u) && SLT(i) == SE_11_SWINGING_DOOR && sprite[j].hitag == SHT(i) && T5(i)) + return; + int soundPlayed = 0; for (SPRITES_OF(STAT_EFFECTOR, i)) { - if (tag == (sector[SECT(i)].lotag & 0x8000u) && SLT(i) == SE_11_SWINGING_DOOR && sprite[j].hitag == SHT(i) && !T5(i)) + if (tag == (sector[SECT(i)].lotag & 0x8000u) && SLT(i) == SE_11_SWINGING_DOOR && sprite[j].hitag == SHT(i)) { if (sector[SECT(i)].lotag & 0x8000u) sector[SECT(i)].lotag &= 0x7fff; else sector[SECT(i)].lotag |= 0x8000u;