Actually commit CWorld, fix CGameArea::Invalidate

This commit is contained in:
Phillip Stephens 2017-11-02 16:36:37 -07:00
parent d7cd8ee7e9
commit e98fc22a2c
2 changed files with 7 additions and 4 deletions

View File

@ -804,13 +804,16 @@ bool CGameArea::Invalidate(CStateManager* mgr)
if (xf0_24_postConstructed) if (xf0_24_postConstructed)
{ {
ClearTokenList(); ClearTokenList();
/* TODO: Verify, not sure if I'm getting this right - Phil */
for (auto it = xf8_loadTransactions.begin(); it != xf8_loadTransactions.end(); ) for (auto it = xf8_loadTransactions.begin(); it != xf8_loadTransactions.end(); )
{ {
if (!(*it)->IsComplete()) if (!(*it)->IsComplete())
{
(*it)->PostCancelRequest(); (*it)->PostCancelRequest();
else ++it;
it = xf8_loadTransactions.erase(it); continue;
}
it = xf8_loadTransactions.erase(it);
} }
if (xf8_loadTransactions.size() != 0) if (xf8_loadTransactions.size() != 0)
return false; return false;

View File

@ -440,7 +440,7 @@ void CWorld::TravelToArea(TAreaId aid, CStateManager& mgr, bool skipLoadOther)
CGameArea* toDeallocateAreas = x4c_chainHeads[0]; CGameArea* toDeallocateAreas = x4c_chainHeads[0];
while (toDeallocateAreas) while (toDeallocateAreas)
{ {
if (toDeallocateAreas->Invalidate(mgr)) if (toDeallocateAreas->Invalidate(&mgr))
{ {
MoveToChain(toDeallocateAreas, EChain::Deallocated); MoveToChain(toDeallocateAreas, EChain::Deallocated);
break; break;