2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:47:43 +00:00

Fix area token loading

This commit is contained in:
Jack Andersen
2018-05-25 17:07:29 -10:00
parent a37fb861e1
commit 0d3a67e78f
7 changed files with 28 additions and 14 deletions

View File

@@ -1313,22 +1313,19 @@ void CGameArea::VerifyTokenList(CStateManager& stateMgr)
if (xac_deps2.empty())
return;
u32 lastOff = 0;
int lidx = 0;
for (u32 off : xbc_layerDepOffsets)
auto end = xac_deps2.end();
for (int lidx = int(xbc_layerDepOffsets.size() - 1) ; lidx >= 0 ; --lidx)
{
auto begin = xac_deps2.begin() + xbc_layerDepOffsets[lidx];
if (stateMgr.LayerState()->IsLayerActive(x4_selfIdx, lidx))
{
auto it = xac_deps2.begin() + lastOff;
auto end = xac_deps2.begin() + off;
for (; it != end ; ++it)
for (auto it = begin ; it != end ; ++it)
{
xdc_tokens.push_back(g_SimplePool->GetObj(*it));
xdc_tokens.back().Lock();
}
}
lastOff = off;
++lidx;
end = begin;
}
}