automap: properly highlight death exit sectors (#1900)

Fixes #1898
This commit is contained in:
Fabian Greffrath 2024-09-13 13:21:53 +02:00 committed by GitHub
parent 43fd3869fd
commit dad1c68407
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 1 deletions

View File

@ -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)
@ -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

View File

@ -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()
//

View File

@ -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);