Fixed water speed issues
This commit is contained in:
parent
8163ca9549
commit
a39564a46a
@ -607,19 +607,19 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
switch(WaterDir)
|
switch(WaterDir)
|
||||||
{
|
{
|
||||||
case X_PLUS:
|
case X_PLUS:
|
||||||
m_WaterSpeed.x = 1.f;
|
m_WaterSpeed.x = 0.2f;
|
||||||
m_bOnGround = false;
|
m_bOnGround = false;
|
||||||
break;
|
break;
|
||||||
case X_MINUS:
|
case X_MINUS:
|
||||||
m_WaterSpeed.x = -1.f;
|
m_WaterSpeed.x = -0.2f;
|
||||||
m_bOnGround = false;
|
m_bOnGround = false;
|
||||||
break;
|
break;
|
||||||
case Z_PLUS:
|
case Z_PLUS:
|
||||||
m_WaterSpeed.z = 1.f;
|
m_WaterSpeed.z = 0.2f;
|
||||||
m_bOnGround = false;
|
m_bOnGround = false;
|
||||||
break;
|
break;
|
||||||
case Z_MINUS:
|
case Z_MINUS:
|
||||||
m_WaterSpeed.z = -1.f;
|
m_WaterSpeed.z = -0.2f;
|
||||||
m_bOnGround = false;
|
m_bOnGround = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -650,7 +650,6 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
{
|
{
|
||||||
if( Ret == 1 )
|
if( Ret == 1 )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( Tracer.HitNormal.x != 0.f ) NextSpeed.x = 0.f;
|
if( Tracer.HitNormal.x != 0.f ) NextSpeed.x = 0.f;
|
||||||
if( Tracer.HitNormal.y != 0.f ) NextSpeed.y = 0.f;
|
if( Tracer.HitNormal.y != 0.f ) NextSpeed.y = 0.f;
|
||||||
if( Tracer.HitNormal.z != 0.f ) NextSpeed.z = 0.f;
|
if( Tracer.HitNormal.z != 0.f ) NextSpeed.z = 0.f;
|
||||||
@ -666,8 +665,10 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
NextPos.z += Tracer.HitNormal.z * 0.3f;
|
NextPos.z += Tracer.HitNormal.z * 0.3f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
NextPos += (NextSpeed * a_Dt);
|
NextPos += (NextSpeed * a_Dt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We didn't hit anything, so move =]
|
// We didn't hit anything, so move =]
|
||||||
|
Loading…
Reference in New Issue
Block a user