Reworked collision to use g_BlockIsSolid
This commit is contained in:
parent
96ef6084ae
commit
b23047f47b
@ -225,24 +225,15 @@ int cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int
|
|||||||
|
|
||||||
BLOCKTYPE BlockID = m_World->GetBlock(pos.x, pos.y, pos.z);
|
BLOCKTYPE BlockID = m_World->GetBlock(pos.x, pos.y, pos.z);
|
||||||
// No collision with water ;)
|
// No collision with water ;)
|
||||||
switch(BlockID)
|
if (g_BlockIsSolid[BlockID])
|
||||||
{
|
{
|
||||||
case E_BLOCK_AIR:
|
BlockHitPosition = pos;
|
||||||
case E_BLOCK_YELLOW_FLOWER:
|
int Normal = GetHitNormal(a_Start, End, pos );
|
||||||
case E_BLOCK_RED_ROSE:
|
if(Normal > 0)
|
||||||
case E_BLOCK_RED_MUSHROOM:
|
|
||||||
case E_BLOCK_BROWN_MUSHROOM:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
{
|
{
|
||||||
BlockHitPosition = pos;
|
HitNormal = m_NormalTable[Normal-1];
|
||||||
int Normal = GetHitNormal(a_Start, End, pos );
|
|
||||||
if(Normal > 0)
|
|
||||||
{
|
|
||||||
HitNormal = m_NormalTable[Normal-1];
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user