Skip to content

Commit

Permalink
Fix btsx e2 map 20
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Apr 2, 2021
1 parent 9c686bc commit c31040e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion prboom2/src/p_maputl.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ dboolean P_BlockLinesIterator(int x, int y, dboolean func(line_t*))
// Most demos go out of sync, and maybe other problems happen, if we
// don't consider linedef 0. For safety this should be qualified.

if (!demo_compatibility) // killough 2/22/98: demo_compatibility check
// killough 2/22/98: demo_compatibility check
// In mbf21, skip if all blocklists start w/ 0 (fixes btsx e2 map 20)
if ((!demo_compatibility && !mbf21) || (mbf21 && skipblstart))
list++; // skip 0 starting delimiter // phares
for ( ; *list != -1 ; list++) // phares
{
Expand Down
7 changes: 7 additions & 0 deletions prboom2/src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ mobj_t **blocklinks; // for thing chains
int blockmapxneg = -257;
int blockmapyneg = -257;

dboolean skipblstart; // MaxW: Skip initial blocklist short

//
// REJECT
// For fast sight rejection.
Expand Down Expand Up @@ -2015,6 +2017,8 @@ static dboolean P_VerifyBlockMap(int count)
int x, y;
int *maxoffs = blockmaplump + count;

skipblstart = true;

for(y = 0; y < bmapheight; y++)
{
for(x = 0; x < bmapwidth; x++)
Expand Down Expand Up @@ -2044,6 +2048,9 @@ static dboolean P_VerifyBlockMap(int count)

list = blockmaplump + offset;

if (*list != 0)
skipblstart = false;

// scan forward for a -1 terminator before maxoffs
for(tmplist = list; ; tmplist++)
{
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/p_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ extern fixed_t bmaporgx;
extern fixed_t bmaporgy; /* origin of block map */
extern mobj_t **blocklinks; /* for thing chains */

extern dboolean skipblstart; // MaxW: Skip initial blocklist short

// MAES: extensions to support 512x512 blockmaps.
extern int blockmapxneg;
extern int blockmapyneg;
Expand Down

0 comments on commit c31040e

Please sign in to comment.