CGameArea: PostConstructArea fix #2 (oops)

This commit is contained in:
Luke Street 2022-08-09 02:50:11 -04:00
parent ff64acad67
commit 54ad0c5933
1 changed files with 4 additions and 3 deletions

View File

@ -917,8 +917,9 @@ void CGameArea::PostConstructArea() {
/* Lights section */ /* Lights section */
if (header.version > 6) { if (header.version > 6) {
CMemoryInStream r(secIt->first, secIt->second, CMemoryInStream::EOwnerShip::NotOwned); CMemoryInStream r(secIt->first, secIt->second, CMemoryInStream::EOwnerShip::NotOwned);
u32 aCount = r.ReadLong(); u32 magic = r.ReadLong();
if (aCount == 0xBABEDEAD) { u32 aCount = magic;
if (magic == 0xBABEDEAD) {
aCount = r.ReadLong(); aCount = r.ReadLong();
} }
x12c_postConstructed->x60_lightsA.reserve(aCount); x12c_postConstructed->x60_lightsA.reserve(aCount);
@ -928,7 +929,7 @@ void CGameArea::PostConstructArea() {
x12c_postConstructed->x70_gfxLightsA.push_back(x12c_postConstructed->x60_lightsA.back().GetAsCGraphicsLight()); x12c_postConstructed->x70_gfxLightsA.push_back(x12c_postConstructed->x60_lightsA.back().GetAsCGraphicsLight());
} }
if (aCount == 0xBABEDEAD) { if (magic == 0xBABEDEAD) {
u32 bCount = r.ReadLong(); u32 bCount = r.ReadLong();
x12c_postConstructed->x80_lightsB.reserve(bCount); x12c_postConstructed->x80_lightsB.reserve(bCount);
x12c_postConstructed->x90_gfxLightsB.reserve(bCount); x12c_postConstructed->x90_gfxLightsB.reserve(bCount);