mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Always set number 255
for tele tiles that don't use the number
Because code previously cast this number to `bool`, we can't use `0` to denote tele tiles where the number is unused.
This commit is contained in:
parent
2e5f37c61b
commit
6d23f3e5bd
|
@ -1179,12 +1179,20 @@ void CLayerTele::BrushDraw(CLayer *pBrush, float wx, float wy)
|
||||||
|
|
||||||
if((m_pEditor->m_AllowPlaceUnusedTiles || IsValidTeleTile(pTeleLayer->m_pTiles[y * pTeleLayer->m_Width + x].m_Index)) && pTeleLayer->m_pTiles[y * pTeleLayer->m_Width + x].m_Index != TILE_AIR)
|
if((m_pEditor->m_AllowPlaceUnusedTiles || IsValidTeleTile(pTeleLayer->m_pTiles[y * pTeleLayer->m_Width + x].m_Index)) && pTeleLayer->m_pTiles[y * pTeleLayer->m_Width + x].m_Index != TILE_AIR)
|
||||||
{
|
{
|
||||||
if(m_pEditor->m_TeleNumber != pTeleLayer->m_TeleNum)
|
if(!IsTeleTileNumberUsed(pTeleLayer->m_pTiles[y * pTeleLayer->m_Width + x].m_Index))
|
||||||
|
{
|
||||||
|
// Tele tile number is unused. Set a known value which is not 0,
|
||||||
|
// as tiles with number 0 would be ignored by previous versions.
|
||||||
|
m_pTeleTile[fy * m_Width + fx].m_Number = 255;
|
||||||
|
}
|
||||||
|
else if(m_pEditor->m_TeleNumber != pTeleLayer->m_TeleNum)
|
||||||
{
|
{
|
||||||
m_pTeleTile[fy * m_Width + fx].m_Number = m_pEditor->m_TeleNumber;
|
m_pTeleTile[fy * m_Width + fx].m_Number = m_pEditor->m_TeleNumber;
|
||||||
}
|
}
|
||||||
else if(pTeleLayer->m_pTeleTile[y * pTeleLayer->m_Width + x].m_Number)
|
else if(pTeleLayer->m_pTeleTile[y * pTeleLayer->m_Width + x].m_Number)
|
||||||
|
{
|
||||||
m_pTeleTile[fy * m_Width + fx].m_Number = pTeleLayer->m_pTeleTile[y * pTeleLayer->m_Width + x].m_Number;
|
m_pTeleTile[fy * m_Width + fx].m_Number = pTeleLayer->m_pTeleTile[y * pTeleLayer->m_Width + x].m_Number;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!m_pEditor->m_TeleNumber)
|
if(!m_pEditor->m_TeleNumber)
|
||||||
|
|
Loading…
Reference in a new issue