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
This commit is contained in:
terminx 2020-03-12 00:58:18 +00:00 committed by Christoph Oelckers
parent 086141e205
commit 7ed8f5aec4

View file

@ -925,11 +925,15 @@ REDODOOR:
if (j >= 0) 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; int soundPlayed = 0;
for (SPRITES_OF(STAT_EFFECTOR, i)) 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; if (sector[SECT(i)].lotag & 0x8000u) sector[SECT(i)].lotag &= 0x7fff;
else sector[SECT(i)].lotag |= 0x8000u; else sector[SECT(i)].lotag |= 0x8000u;