diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-07-31 16:13:27 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-17 22:46:46 +0100 |
commit | 18e394c993f71b85ab3dd172cd2ac3b209363400 (patch) | |
tree | ae611ae11a98c1bb98e55095f113b5459d513375 /src | |
parent | 917d9b76213368354c41b552a085618638458f85 (diff) |
Core/PetAI: Change an assert to a TC_LOG_ERROR
(cherry picked from commit c3619f42a56fb6aaadc15ca63fe95fc0f519428d)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CoreAI/PetAI.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 67ae4ebb115..0adbf47633a 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -487,7 +487,11 @@ bool PetAI::CanAttack(Unit* target) return false; } - ASSERT(me->GetCharmInfo()); + if (!me->GetCharmInfo()) + { + TC_LOG_ERROR("scripts.ai.petai", "me->GetCharmInfo() is NULL in PetAI::CanAttack(). Debug info: %s", GetDebugInfo().c_str()); + return false; + } // Passive - passive pets can attack if told to if (me->HasReactState(REACT_PASSIVE)) |