mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Use bool
for IsCheckTeleport
and IsCheckEvilTeleport
The tele tile number is not used for `TILE_TELECHECKIN` and `TILE_TELECHECKINEVIL` and the results of these functions were always implicitly converted to `bool` while assuming that the tele number was not `0` for these tiles.
This commit is contained in:
parent
c23c5d900e
commit
245703798b
|
@ -634,30 +634,18 @@ int CCollision::IsEvilTeleport(int Index) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CCollision::IsCheckTeleport(int Index) const
|
||||
bool CCollision::IsCheckTeleport(int Index) const
|
||||
{
|
||||
if(Index < 0)
|
||||
return 0;
|
||||
if(!m_pTele)
|
||||
return 0;
|
||||
|
||||
if(m_pTele[Index].m_Type == TILE_TELECHECKIN)
|
||||
return m_pTele[Index].m_Number;
|
||||
|
||||
return 0;
|
||||
if(Index < 0 || !m_pTele)
|
||||
return false;
|
||||
return m_pTele[Index].m_Type == TILE_TELECHECKIN;
|
||||
}
|
||||
|
||||
int CCollision::IsCheckEvilTeleport(int Index) const
|
||||
bool CCollision::IsCheckEvilTeleport(int Index) const
|
||||
{
|
||||
if(Index < 0)
|
||||
return 0;
|
||||
if(!m_pTele)
|
||||
return 0;
|
||||
|
||||
if(m_pTele[Index].m_Type == TILE_TELECHECKINEVIL)
|
||||
return m_pTele[Index].m_Number;
|
||||
|
||||
return 0;
|
||||
if(Index < 0 || !m_pTele)
|
||||
return false;
|
||||
return m_pTele[Index].m_Type == TILE_TELECHECKINEVIL;
|
||||
}
|
||||
|
||||
int CCollision::IsTeleCheckpoint(int Index) const
|
||||
|
|
|
@ -84,8 +84,8 @@ public:
|
|||
int GetFTileFlags(int Index) const;
|
||||
int IsTeleport(int Index) const;
|
||||
int IsEvilTeleport(int Index) const;
|
||||
int IsCheckTeleport(int Index) const;
|
||||
int IsCheckEvilTeleport(int Index) const;
|
||||
bool IsCheckTeleport(int Index) const;
|
||||
bool IsCheckEvilTeleport(int Index) const;
|
||||
int IsTeleportWeapon(int Index) const;
|
||||
int IsTeleportHook(int Index) const;
|
||||
int IsTeleCheckpoint(int Index) const;
|
||||
|
|
Loading…
Reference in a new issue