summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-06-02 14:16:36 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2014-06-02 14:16:36 +0200
commitb9ca7bd1203f704d4f9d6215d72728d40a187b7c (patch)
tree0ab2885d4528f1160d58721681971577c9392fa7
parentcBlockArea reading hotfix. (diff)
downloadcuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar.gz
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar.bz2
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar.lz
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar.xz
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.tar.zst
cuberite-b9ca7bd1203f704d4f9d6215d72728d40a187b7c.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index a9ca7a2fa..5843ca5a6 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -301,7 +301,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
if (DoesPosYRequireJump((int)floor(m_Destination.y)))
{
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.Normalize();
- Distance *= 5;
- SetSpeedX(Distance.x);
- SetSpeedZ(Distance.z);
+
+ if (m_bOnGround)
+ {
+ 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)
{ //Runs Faster when escaping :D otherwise they just walk away