Skip to content

Commit

Permalink
automap: properly highlight death exit sectors (#1900)
Browse files Browse the repository at this point in the history
Fixes #1898
  • Loading branch information
fabiangreffrath authored Sep 13, 2024
1 parent 43fd386 commit dad1c68
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,8 +1703,12 @@ static void AM_drawWalls(void)

if (!lines[i].backsector)
{
if (mapcolor_exit && P_IsDeathExit(lines[i].frontsector))
{
array_push(lines_1S, ((am_line_t){l, keyed_door_flash ? mapcolor_grid : mapcolor_exit}));
}
// jff 1/10/98 add new color for 1S secret sector boundary
if (mapcolor_secr && //jff 4/3/98 0 is disable
else if (mapcolor_secr && //jff 4/3/98 0 is disable
(
!map_secret_after &&
P_IsSecret(lines[i].frontsector)
Expand Down Expand Up @@ -1756,6 +1760,13 @@ static void AM_drawWalls(void)
{
AM_drawMline(&l, mapcolor_clsd); // non-secret closed door
} //jff 1/6/98 show secret sector 2S lines
else if (mapcolor_exit &&
(P_IsDeathExit(lines[i].frontsector) ||
P_IsDeathExit(lines[i].backsector))
)
{
AM_drawMline(&l, keyed_door_flash ? mapcolor_grid : mapcolor_exit);
}
else if
(
mapcolor_secr && //jff 2/16/98 fixed bug
Expand Down
16 changes: 16 additions & 0 deletions src/p_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,22 @@ int P_CheckTag(line_t *line)
return 0;
}

boolean P_IsDeathExit(sector_t *sector)
{
if (sector->special < 32)
{
return (sector->special == 11);
}
else if (mbf21 && sector->special & DEATH_MASK)
{
const int i = (sector->special & DAMAGE_MASK) >> DAMAGE_SHIFT;

return (i == 2 || i == 3);
}

return false;
}

//
// P_IsSecret()
//
Expand Down
2 changes: 2 additions & 0 deletions src/p_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,8 @@ boolean P_CanUnlockGenDoor(struct line_s *line, struct player_s *player);

int P_SectorActive(special_e t, struct sector_s *s);

boolean P_IsDeathExit(struct sector_s *sec);

boolean P_IsSecret(struct sector_s *sec);

boolean P_WasSecret(struct sector_s *sec);
Expand Down

0 comments on commit dad1c68

Please sign in to comment.