Ignore switch tiles that don't use number for free slot finder

This commit is contained in:
Robert Müller 2023-03-04 12:18:04 +01:00
parent c4eca1a0ba
commit 97052e4752

View file

@ -1865,7 +1865,7 @@ bool CLayerSwitch::ContainsElementWithId(int Id)
{
for(int x = 0; x < m_Width; ++x)
{
if(m_pSwitchTile[y * m_Width + x].m_Number == Id)
if(IsSwitchTileNumberUsed(m_pSwitchTile[y * m_Width + x].m_Type) && m_pSwitchTile[y * m_Width + x].m_Number == Id)
{
return true;
}