mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Revert "Updated GetTile for FrontLayer"
This reverts commit 19e379afdf
.
Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
parent
341746441e
commit
6167c1a9a4
|
@ -173,23 +173,18 @@ int CCollision::GetTile(int x, int y)
|
|||
int nx = clamp(x/32, 0, m_Width-1);
|
||||
int ny = clamp(y/32, 0, m_Height-1);
|
||||
/*dbg_msg("GetTile","m_Index %d",m_pTiles[ny*m_Width+nx].m_Index);//Remove */
|
||||
if(m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_SOLID ||
|
||||
m_pTiles[ny*m_Width+nx].m_Index == (COLFLAG_SOLID|COLFLAG_NOHOOK) ||
|
||||
m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_DEATH ||
|
||||
m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_NOLASER ||
|
||||
(m_pFront && (m_pFront[ny*m_Width+nx].m_Index == COLFLAG_SOLID)) ||
|
||||
(m_pFront && (m_pFront[ny*m_Width+nx].m_Index == (COLFLAG_SOLID|COLFLAG_NOHOOK))) ||
|
||||
(m_pFront && (m_pFront[ny*m_Width+nx].m_Index == COLFLAG_DEATH)) ||
|
||||
(m_pFront && (m_pFront[ny*m_Width+nx].m_Index == COLFLAG_NOLASER)))
|
||||
|
||||
if(m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_SOLID
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == (COLFLAG_SOLID|COLFLAG_NOHOOK)
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_DEATH
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_NOLASER)
|
||||
return m_pTiles[ny*m_Width+nx].m_Index;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
int CCollision::Entity(int x, int y, bool Front)
|
||||
{
|
||||
if(0 < x || x >= m_Width) return 0;
|
||||
if(0 < y || y >= m_Height) return 0;
|
||||
//if(0 < x || x >= m_Width) return 0;
|
||||
//if(0 < y || y >= m_Height) return 0;
|
||||
int Index = Front?m_pFront[y*m_Width+x].m_Index:m_pTiles[y*m_Width+x].m_Index;
|
||||
return Index-ENTITY_OFFSET;
|
||||
}
|
||||
|
@ -276,7 +271,7 @@ int CCollision::IntersectNoLaserNW(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, ve
|
|||
{
|
||||
float a = f/d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
if(CheckPoint(Pos.x, Pos.y) || IsNoLaser(round(Pos.x), round(Pos.y)))
|
||||
if(IsSolid(round(Pos.x), round(Pos.y)) || IsNoLaser(round(Pos.x), round(Pos.y)))
|
||||
{
|
||||
if(pOutCollision)
|
||||
*pOutCollision = Pos;
|
||||
|
|
Loading…
Reference in a new issue