Small tweak for mobs
Mobs move a bit smoother and aren't able to move allot when in air.
This commit is contained in:
parent
b7dc4177d0
commit
b9ca7bd120
@ -301,7 +301,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
if (DoesPosYRequireJump((int)floor(m_Destination.y)))
|
if (DoesPosYRequireJump((int)floor(m_Destination.y)))
|
||||||
{
|
{
|
||||||
m_bOnGround = false;
|
m_bOnGround = false;
|
||||||
AddPosY(1.5); // Jump!!
|
AddSpeedY(5.2); // Jump!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,9 +310,19 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
{
|
{
|
||||||
Distance.y = 0;
|
Distance.y = 0;
|
||||||
Distance.Normalize();
|
Distance.Normalize();
|
||||||
Distance *= 5;
|
|
||||||
SetSpeedX(Distance.x);
|
if (m_bOnGround)
|
||||||
SetSpeedZ(Distance.z);
|
{
|
||||||
|
Distance *= 2.5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Don't let the mob move too much if he's falling.
|
||||||
|
Distance *= 0.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
AddSpeedX(Distance.x);
|
||||||
|
AddSpeedZ(Distance.z);
|
||||||
|
|
||||||
if (m_EMState == ESCAPING)
|
if (m_EMState == ESCAPING)
|
||||||
{ //Runs Faster when escaping :D otherwise they just walk away
|
{ //Runs Faster when escaping :D otherwise they just walk away
|
||||||
|
Loading…
x
Reference in New Issue
Block a user