summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Horse.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-12-15 22:53:23 +0100
committerworktycho <work.tycho@gmail.com>2015-12-15 22:53:23 +0100
commit83418e1d7a31e247b0d7892e75e70abc14b9aad8 (patch)
treebd391b7fe84756a5290f0ee0a28ab318a3a47728 /src/Mobs/Horse.cpp
parentMerge pull request #2750 from cuberite/wrng (diff)
parentallow horse control (still quite buggy) (diff)
downloadcuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar.gz
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar.bz2
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar.lz
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar.xz
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.tar.zst
cuberite-83418e1d7a31e247b0d7892e75e70abc14b9aad8.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Horse.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/Mobs/Horse.cpp b/src/Mobs/Horse.cpp
index a338f12bd..f133f9912 100644
--- a/src/Mobs/Horse.cpp
+++ b/src/Mobs/Horse.cpp
@@ -23,7 +23,8 @@ cHorse::cHorse(int Type, int Color, int Style, int TameTimes) :
m_Armour(0),
m_TimesToTame(TameTimes),
m_TameAttemptTimes(0),
- m_RearTickCount(0)
+ m_RearTickCount(0),
+ m_Speed(20.0)
{
}
@@ -67,6 +68,7 @@ void cHorse::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
else
{
+ // TODO: emit hearts here
m_bIsTame = true;
}
}
@@ -158,3 +160,21 @@ void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cHorse::InStateIdle(std::chrono::milliseconds a_Dt)
+{
+ // If horse is tame and someone is sitting on it, don't walk around
+ if ((!m_bIsTame) || (m_Attachee == nullptr))
+ {
+ super::InStateIdle(a_Dt);
+ }
+}
+
+
+
+
+
+void cHorse::HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
+{
+ super::HandleSpeedFromAttachee(a_Forward * m_Speed, a_Sideways * m_Speed);
+}