mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Add IsTeleTileNumberUsed
function
To check whether the number of a tele tile is used or not.
This commit is contained in:
parent
245703798b
commit
9c841f1e43
|
@ -1335,11 +1335,7 @@ bool CLayerTele::ContainsElementWithId(int Id)
|
|||
{
|
||||
for(int x = 0; x < m_Width; ++x)
|
||||
{
|
||||
if(m_pTeleTile[y * m_Width + x].m_Type == TILE_TELECHECKIN)
|
||||
continue;
|
||||
if(m_pTeleTile[y * m_Width + x].m_Type == TILE_TELECHECKINEVIL)
|
||||
continue;
|
||||
if(m_pTeleTile[y * m_Width + x].m_Number == Id)
|
||||
if(IsTeleTileNumberUsed(m_pTeleTile[y * m_Width + x].m_Type) && m_pTeleTile[y * m_Width + x].m_Number == Id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,12 @@ bool IsValidTeleTile(int Index)
|
|||
Index == TILE_TELECHECKINEVIL);
|
||||
}
|
||||
|
||||
bool IsTeleTileNumberUsed(int Index)
|
||||
{
|
||||
return Index != TILE_TELECHECKIN &&
|
||||
Index != TILE_TELECHECKINEVIL;
|
||||
}
|
||||
|
||||
bool IsValidSpeedupTile(int Index)
|
||||
{
|
||||
return Index == TILE_BOOST;
|
||||
|
|
|
@ -489,6 +489,7 @@ public:
|
|||
bool IsValidGameTile(int Index);
|
||||
bool IsValidFrontTile(int Index);
|
||||
bool IsValidTeleTile(int Index);
|
||||
bool IsTeleTileNumberUsed(int Index); // Assumes that Index is a valid tele tile index
|
||||
bool IsValidSpeedupTile(int Index);
|
||||
bool IsValidSwitchTile(int Index);
|
||||
bool IsValidTuneTile(int Index);
|
||||
|
|
Loading…
Reference in a new issue