summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-23 14:39:49 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-23 14:39:49 +0200
commit4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd (patch)
treecd86062eb50ba870f73b6f29dec0205f87205bf8 /src/Mobs/Monster.cpp
parentMerge branch 'master' into EntityCustomName (diff)
parentQtBiomeVisualiser: Fixed confusion about Globals.h. (diff)
downloadcuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar.gz
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar.bz2
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar.lz
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar.xz
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.tar.zst
cuberite-4b38e077cf8d27d1c7ef26d4148f7825c5aeaabd.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index b0b836dff..339367f47 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -91,6 +91,7 @@ cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString
, m_DropChanceBoots(0.085f)
, m_CanPickUpLoot(true)
, m_BurnsInDaylight(false)
+ , m_RelativeWalkSpeed(1.0)
{
if (!a_ConfigName.empty())
{
@@ -284,7 +285,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
}
}
- Vector3f Distance = m_Destination - GetPosition();
+ Vector3d Distance = m_Destination - GetPosition();
if (!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move
{
Distance.y = 0;
@@ -304,6 +305,9 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
Distance *= 0.25f;
}
+ // Apply walk speed:
+ Distance *= m_RelativeWalkSpeed;
+
AddSpeedX(Distance.x);
AddSpeedZ(Distance.z);