mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- Fixed: The BUILD map loader did not create extsector information, and it also did not
set valid sidedef references for the backs of one-sided lines. SVN r2218 (trunk)
This commit is contained in:
parent
8e104d0a28
commit
92890066b6
2 changed files with 22 additions and 10 deletions
|
@ -253,11 +253,11 @@ static bool P_LoadBloodMap (BYTE *data, size_t len, FMapThing **mapthings, int *
|
|||
{
|
||||
memcpy (infoBlock, data + 6, 37);
|
||||
}
|
||||
numRevisions = *(DWORD *)(infoBlock + 27);
|
||||
numsectors = *(WORD *)(infoBlock + 31);
|
||||
numWalls = *(WORD *)(infoBlock + 33);
|
||||
numsprites = *(WORD *)(infoBlock + 35);
|
||||
skyLen = 2 << *(WORD *)(infoBlock + 16);
|
||||
numRevisions = LittleLong(*(DWORD *)(infoBlock + 27));
|
||||
numsectors = LittleShort(*(WORD *)(infoBlock + 31));
|
||||
numWalls = LittleShort(*(WORD *)(infoBlock + 33));
|
||||
numsprites = LittleShort(*(WORD *)(infoBlock + 35));
|
||||
skyLen = 2 << LittleShort(*(WORD *)(infoBlock + 16));
|
||||
|
||||
if (mapver == 7)
|
||||
{
|
||||
|
@ -365,6 +365,8 @@ static void LoadSectors (sectortype *bsec)
|
|||
sec = sectors = new sector_t[numsectors];
|
||||
memset (sectors, 0, sizeof(sector_t)*numsectors);
|
||||
|
||||
sectors[0].e = new extsector_t[numsectors];
|
||||
|
||||
for (int i = 0; i < numsectors; ++i, ++bsec, ++sec)
|
||||
{
|
||||
bsec->wallptr = WORD(bsec->wallptr);
|
||||
|
@ -372,6 +374,7 @@ static void LoadSectors (sectortype *bsec)
|
|||
bsec->ceilingstat = WORD(bsec->ceilingstat);
|
||||
bsec->floorstat = WORD(bsec->floorstat);
|
||||
|
||||
sec->e = §ors[0].e[i];
|
||||
sec->SetPlaneTexZ(sector_t::floor, -(LittleLong(bsec->floorz) << 8));
|
||||
sec->floorplane.d = -sec->GetPlaneTexZ(sector_t::floor);
|
||||
sec->floorplane.c = FRACUNIT;
|
||||
|
@ -633,14 +636,17 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec)
|
|||
R_AlignFlat (linenum, sidenum == bsec->wallptr, 0);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < numsides; i++)
|
||||
{
|
||||
sides[i].linedef = &lines[intptr_t(sides[i].linedef)];
|
||||
}
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
lines[i].sidedef[0] = &sides[intptr_t(lines[i].sidedef[0])];
|
||||
lines[i].sidedef[1] = &sides[intptr_t(lines[i].sidedef[1])];
|
||||
intptr_t front = intptr_t(lines[i].sidedef[0]);
|
||||
intptr_t back = intptr_t(lines[i].sidedef[1]);
|
||||
lines[i].sidedef[0] = front >= 0 ? &sides[front] : NULL;
|
||||
lines[i].sidedef[1] = back >= 0 ? &sides[back] : NULL;
|
||||
}
|
||||
for (i = 0; i < numsides; i++)
|
||||
{
|
||||
assert(sides[i].sector != NULL);
|
||||
sides[i].linedef = &lines[intptr_t(sides[i].linedef)];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -711,9 +711,15 @@ void P_FloodZone (sector_t *sec, int zonenum)
|
|||
continue;
|
||||
|
||||
if (check->frontsector == sec)
|
||||
{
|
||||
assert(check->backsector != NULL);
|
||||
other = check->backsector;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(check->frontsector != NULL);
|
||||
other = check->frontsector;
|
||||
}
|
||||
|
||||
if (other->ZoneNumber != zonenum)
|
||||
P_FloodZone (other, zonenum);
|
||||
|
|
Loading…
Reference in a new issue