diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 11:13:36 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 11:13:36 +0100 |
commit | e2a053263f4798f879392756bb056eabf0ade3a4 (patch) | |
tree | 5d543baa8842fe74c4ed66984860be483d28c627 /src/Mobs/Wolf.h | |
parent | Merge pull request #2853 from cuberite/DetailedBlockAreaLogging (diff) | |
parent | Tamed wolf assists owner (attack / defence) (diff) | |
download | cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.gz cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.bz2 cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.lz cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.xz cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.zst cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.zip |
Diffstat (limited to 'src/Mobs/Wolf.h')
-rw-r--r-- | src/Mobs/Wolf.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h index ed37367b9..57178a3f4 100644 --- a/src/Mobs/Wolf.h +++ b/src/Mobs/Wolf.h @@ -12,7 +12,7 @@ class cWolf : public cPassiveAggressiveMonster { typedef cPassiveAggressiveMonster super; - + public: cWolf(void); @@ -45,6 +45,16 @@ public: m_OwnerUUID = a_NewOwnerUUID; } + /** Notfies the wolf that the player a_Player is being attacked by a_Attacker. + The wolf will then defend the player by attacking a_Attacker if all these conditions are met: + - a_Player is the wolf's owner. + - The wolf is not already attacking a mob. + - The wolf is not sitting. + This is called by cPlayer::NotifyFriendlyWolves whenever a player takes or deals damage and a wolf is nearby. */ + void NearbyPlayerIsFighting(cPlayer * a_Player, cEntity * a_Opponent); + + virtual void InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; + protected: bool m_IsSitting; |