From c5333d4abb80ea81a8a92ed5d27b4ee36e19e8b7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Apr 2008 19:10:37 +0000 Subject: [PATCH] - Changed secret sector drawing in automap so that lines with the ML_SECRET flag are only drawn as part of a secret sector if that secret has already been found, even if the option is set to always show secret sectors. - Added a NULL pointer check to WI_LoadBackground. SVN r885 (trunk) --- docs/rh-log.txt | 3 +++ src/am_map.cpp | 16 ++++++++++------ src/wi_stuff.cpp | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 91cf8d951..ca3b8e848 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ April 5, 2008 (Changes by Graf Zahl) +- Changed secret sector drawing in automap so that lines with the ML_SECRET + flag are only drawn as part of a secret sector if that secret has already + been found, even if the option is set to always show secret sectors. - Added the option to use $ as a prefix to a string table name everywhere in MAPINFO where 'lookup' could be specified so that there is one consistent way to do it. diff --git a/src/am_map.cpp b/src/am_map.cpp index 132b281e7..c0ed1deaa 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -1297,15 +1297,19 @@ static bool AM_CheckSecret(line_t *line) { if (line->frontsector != NULL) { - if (line->frontsector->oldspecial && - (am_map_secrets==2 || (am_map_secrets==1 && !(line->frontsector->special&SECRET_MASK)))) - return true; + if (line->frontsector->oldspecial) + { + if (am_map_secrets!=0 && !(line->frontsector->special&SECRET_MASK)) return true; + if (am_map_secrets==2 && !(line->flags & ML_SECRET)) return true; + } } if (line->backsector != NULL) { - if (line->backsector->oldspecial && - (am_map_secrets==2 || (am_map_secrets==1 && !(line->backsector->special&SECRET_MASK)))) - return true; + if (line->backsector->oldspecial) + { + if (am_map_secrets!=0 && !(line->backsector->special&SECRET_MASK)) return true; + if (am_map_secrets==2 && !(line->flags & ML_SECRET)) return true; + } } return false; } diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index fbc8c480f..0c47f5df6 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -331,7 +331,7 @@ void WI_LoadBackground(bool isenterpic) // If going from E1-E3 to E4 the default should be used, not the exit pic. // Not if the exit pic is user defined! - if (level.info->exitpic[0]!=0) return; + if (level.info->exitpic != NULL && level.info->exitpic[0]!=0) return; // E1-E3 need special treatment when playing Doom 1. if (gamemode!=commercial)