mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- Blood: validate upper/lower sector links before starting a level.
Originally this just performed an OOB memory access, but with Raze's setup it would dereference a null pointer so these must be eliminated.
This commit is contained in:
parent
6c1632a744
commit
d011f3c201
2 changed files with 26 additions and 0 deletions
|
@ -36,6 +36,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
BEGIN_BLD_NS
|
||||
|
||||
void validateLinks();
|
||||
|
||||
|
||||
FixedBitArray<MAXSPRITES> activeXSprites;
|
||||
|
||||
// All AI states for assigning an index.
|
||||
|
@ -817,6 +820,7 @@ void GameInterface::SerializeGameState(FSerializer& arc)
|
|||
Polymost::Polymost_prepare_loadboard();
|
||||
Mus_ResumeSaved();
|
||||
}
|
||||
validateLinks();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,6 +34,27 @@ ZONE gStartZone[8];
|
|||
ZONE gStartZoneTeam2[8];
|
||||
bool gTeamsSpawnUsed = false;
|
||||
#endif
|
||||
|
||||
void validateLinks()
|
||||
{
|
||||
int snum = 0;
|
||||
for (auto& sect : sectors())
|
||||
{
|
||||
|
||||
if (getUpperLink(snum) && !getUpperLink(snum)->GetOwner())
|
||||
{
|
||||
Printf("Unpartnered upper link in sector %d\n", snum);
|
||||
gUpperLink[snum] = nullptr;
|
||||
}
|
||||
if (getLowerLink(snum) && !getLowerLink(snum)->GetOwner())
|
||||
{
|
||||
Printf("Unpartnered upper link in sector %d\n", snum);
|
||||
gLowerLink[snum] = nullptr;
|
||||
}
|
||||
snum++;
|
||||
}
|
||||
}
|
||||
|
||||
void warpInit(void)
|
||||
{
|
||||
for (int i = 0; i < kMaxSectors; i++)
|
||||
|
@ -166,6 +187,7 @@ void warpInit(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
validateLinks();
|
||||
}
|
||||
|
||||
int CheckLink(DBloodActor *actor)
|
||||
|
|
Loading…
Reference in a new issue