From 359e772dee0ef4595c8ad982f17e13725f255219 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Mon, 11 Jan 2016 21:34:41 +0200 Subject: Tamed wolf assists owner (attack / defence) --- src/Mobs/Wolf.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Mobs/Wolf.h') 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; -- cgit v1.2.3