From 3b35a00397d7919b0613be8f6f756beabad53edc Mon Sep 17 00:00:00 2001 From: TheHyper45 <86074167+TheHyper45@users.noreply.github.com> Date: Sat, 19 Jun 2021 22:25:24 +0100 Subject: Death messages for tamed pets and ocelots are now tamable. (#5243) * Fixing bugs regarding wolfs and ocelots * Death messages appear after killing tamed ocelots and wolfs * Style fix * Added myself to the CONTRIBUTORS file * Removed redundant string initialization * Removed an unsafe cast. * Changed the order of initialization of fields in constuctor of class cOcelot --- src/Mobs/Monster.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 447e66261..d99f2cddc 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -605,6 +605,15 @@ void cMonster::KilledBy(TakeDamageInfo & a_TDI) { m_World->BroadcastSoundEffect(m_SoundDeath, GetPosition(), 1.0f, 0.8f); } + + if (IsTame()) + { + if ((m_MobType == mtWolf) || (m_MobType == mtOcelot) || (m_MobType == mtCat) || (m_MobType == mtParrot)) + { + BroadcastDeathMessage(a_TDI); + } + } + int Reward; switch (m_MobType) { -- cgit v1.2.3