@@ -749,6 +749,7 @@ int CClient::OnSkill_AnimalLore( CUID uid, int iSkillLevel, bool fTest )
749749{
750750 ADDTOCALLSTACK (" CClient::OnSkill_AnimalLore" );
751751 UnreferencedParameter (iSkillLevel);
752+ // Returns: difficulty.
752753 // SKILL_ANIMALLORE
753754 // The creature is a "human" etc..
754755 // How happy.
@@ -794,14 +795,22 @@ int CClient::OnSkill_AnimalLore( CUID uid, int iSkillLevel, bool fTest )
794795 }
795796
796797 // Who is master ?
797- CChar * pCharOwner = pChar->NPC_PetGetOwner ();
798+ CChar * pCharOwner = nullptr ;
799+ if (pChar->IsNPC ())
800+ {
801+ pCharOwner = pChar->NPC_PetGetOwner ();
802+ }
803+
798804 if ( pCharOwner == nullptr )
799805 {
800- snprintf (pszTemp, Str_TempLength (), g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_FREE ), pszHe, pszHis);
806+ snprintf (pszTemp, Str_TempLength (), g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_FREE ),
807+ pszHe, pszHis);
801808 }
802809 else
803810 {
804- snprintf (pszTemp, Str_TempLength (), g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_MASTER ), pszHe, ( pCharOwner == m_pChar ) ? g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_MASTER_YOU ) : pCharOwner->GetName ());
811+ lpctstr ptcMasterName = ( pCharOwner == m_pChar ) ? g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_MASTER_YOU ) : pCharOwner->GetName ();
812+ snprintf (pszTemp, Str_TempLength (), g_Cfg.GetDefaultMsg ( DEFMSG_ANIMALLORE_MASTER ),
813+ pszHe, ptcMasterName);
805814 // How loyal to master ?
806815 }
807816 addObjMessage (pszTemp, pChar );
0 commit comments