Fix issue where swingdoors would refuse to open or close if an enemy was in front of the door in an overlapping but unrelated/disjoint sector

git-svn-id: https://svn.eduke32.com/eduke32@7473 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2019-04-05 17:45:22 +00:00 committed by Christoph Oelckers
parent f7f62c4466
commit 0bfde1c4d3
3 changed files with 8 additions and 5 deletions

View file

@ -88,6 +88,8 @@ extern int16_t clipsectorlist[MAXCLIPSECTORS], origclipsectorlist[MAXCLIPSECTORS
int clipinsidebox(vec2_t *vect, int wallnum, int walldist);
int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist);
int sectoradjacent(int sect1, int sect2);
extern int32_t clipmoveboxtracenum;
int32_t clipmove(vec3_t *pos, int16_t *sectnum, int32_t xvect, int32_t yvect, int32_t walldist, int32_t ceildist,

View file

@ -909,8 +909,7 @@ static int32_t get_floorspr_clipyou(int32_t x1, int32_t x2, int32_t x3, int32_t
return clipyou;
}
#if 0
static int sectoradjacent(int sect1, int sect2)
int sectoradjacent(int sect1, int sect2)
{
if (sector[sect1].wallnum > sector[sect2].wallnum)
swaplong(&sect1, &sect2);
@ -921,7 +920,6 @@ static int sectoradjacent(int sect1, int sect2)
return 0;
}
#endif
//
// clipmove

View file

@ -6676,8 +6676,11 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
{
for (SPRITES_OF(STAT_ACTOR, k))
{
if (sprite[k].extra > 0 && A_CheckEnemySprite(&sprite[k])
&& clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1)
if (sprite[k].extra > 0 &&
(pSprite->sectnum == sprite[k].sectnum ||
sectoradjacent(pSprite->sectnum, sprite[k].sectnum)) &&
A_CheckEnemySprite(&sprite[k]) &&
clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1)
goto next_sprite;
}
}