diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-10-11 22:33:56 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-10-11 22:33:56 +0200 |
commit | 327abdd10daad7bb49fde185f1f5aee60a98ec1c (patch) | |
tree | edddb203eb17e037c9e6370cc4ff065f36e9ef63 /source | |
parent | Fifth round of fixes (diff) | |
download | cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar.gz cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar.bz2 cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar.lz cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar.xz cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.tar.zst cuberite-327abdd10daad7bb49fde185f1f5aee60a98ec1c.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/Mobs/Horse.cpp | 11 | ||||
-rw-r--r-- | source/Mobs/Horse.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp index caa1a3deb..46e7969cc 100644 --- a/source/Mobs/Horse.cpp +++ b/source/Mobs/Horse.cpp @@ -22,7 +22,8 @@ cHorse::cHorse(int Type, int Color, int Style, int TameTimes) : m_Style(Style), m_Armour(0), m_TimesToTame(TameTimes), - m_TameAttemptTimes(0) + m_TameAttemptTimes(0), + m_RearTickCount(0) { } @@ -70,9 +71,13 @@ void cHorse::Tick(float a_Dt, cChunk & a_Chunk) } } - if ((m_bIsRearing) && (m_World->GetTickRandomNumber(15) == 6)) + if (m_bIsRearing) { - m_bIsRearing = false; + if (m_RearTickCount == 20) + { + m_bIsRearing = false; + } + else { m_RearTickCount++;} } m_World->BroadcastEntityMetadata(*this); diff --git a/source/Mobs/Horse.h b/source/Mobs/Horse.h index d80678845..be0c23f9b 100644 --- a/source/Mobs/Horse.h +++ b/source/Mobs/Horse.h @@ -35,7 +35,7 @@ public: private: bool m_bHasChest, m_bIsEating, m_bIsRearing, m_bIsMouthOpen, m_bIsTame, m_bIsSaddled; - int m_Type, m_Color, m_Style, m_Armour, m_TimesToTame, m_TameAttemptTimes; + int m_Type, m_Color, m_Style, m_Armour, m_TimesToTame, m_TameAttemptTimes, m_RearTickCount; } ; |