actors.cpp: improve SE_11_SWINGING_DOOR detection and handling of players that block a door's path

git-svn-id: https://svn.eduke32.com/eduke32@6893 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-05-22 10:01:17 +00:00
parent 7c7b8f62a9
commit 712646f713

View file

@ -6649,23 +6649,30 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
&& clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1)
goto next_sprite;
}
}
l = (SP(spriteNum) >> 3) * pData[3];
pData[2] += l;
pData[4] += l;
A_MoveSector(spriteNum);
setsprite(spriteNum, (vec3_t *)pSprite);
for (j=pSector->wallptr; j<endWall; j++)
{
for (SPRITES_OF(STAT_PLAYER, k))
{
if (sprite[k].owner >= 0 && clipinsidebox((vec2_t *)&sprite[k], j, pPlayer->clipdist + 40) == 1)
if (sprite[k].owner >= 0 && clipinsidebox((vec2_t *)&sprite[k], j, pPlayer->clipdist))
{
pData[5] = 8; // Delay
pData[2] -= l;
pData[4] -= l;
A_MoveSector(spriteNum);
setsprite(spriteNum, (vec3_t *)pSprite);
goto next_sprite;
}
}
}
k = (SP(spriteNum) >> 3) * pData[3];
pData[2] += k;
pData[4] += k;
A_MoveSector(spriteNum);
setsprite(spriteNum, (vec3_t *)pSprite);
if (pData[4] <= -511 || pData[4] >= 512)
{
pData[4] = 0;