Fixed rendering of maps like Hardcore_02

Since the game layers are allowed only once, there is not way for this to run twice
This commit is contained in:
GreYFoX 2011-08-27 15:02:39 +02:00
parent 7e6f6465b7
commit 7e19f1bca3

View file

@ -40,13 +40,6 @@ void CLayers::Init(class IKernel *pKernel)
{
CMapItemLayerTilemap *pTilemap = reinterpret_cast<CMapItemLayerTilemap *>(pLayer);
if(pTilemap->m_Version <= 2)
{
pTilemap->m_Switch = *((int*)(pTilemap) + 18);
pTilemap->m_Front = *((int*)(pTilemap) + 17);
pTilemap->m_Speedup = *((int*)(pTilemap) + 16);
pTilemap->m_Tele = *((int*)(pTilemap) + 15);
}
if(pTilemap->m_Flags&TILESLAYERFLAG_GAME)
{
@ -71,13 +64,37 @@ void CLayers::Init(class IKernel *pKernel)
//break;
}
if(pTilemap->m_Flags&TILESLAYERFLAG_TELE)
{
if(pTilemap->m_Version <= 2)
{
pTilemap->m_Tele = *((int*)(pTilemap) + 15);
}
m_pTeleLayer = pTilemap;
}
if(pTilemap->m_Flags&TILESLAYERFLAG_SPEEDUP)
{
if(pTilemap->m_Version <= 2)
{
pTilemap->m_Speedup = *((int*)(pTilemap) + 16);
}
m_pSpeedupLayer = pTilemap;
}
if(pTilemap->m_Flags&TILESLAYERFLAG_FRONT)
{
if(pTilemap->m_Version <= 2)
{
pTilemap->m_Front = *((int*)(pTilemap) + 17);
}
m_pFrontLayer = pTilemap;
}
if(pTilemap->m_Flags&TILESLAYERFLAG_SWITCH)
{
if(pTilemap->m_Version <= 2)
{
pTilemap->m_Switch = *((int*)(pTilemap) + 18);
}
m_pSwitchLayer = pTilemap;
}
}
}
}