diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-07-31 16:13:27 +0200 |
---|---|---|
committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-07-31 16:15:01 +0200 |
commit | c3619f42a56fb6aaadc15ca63fe95fc0f519428d (patch) | |
tree | 41eb95a1687ac4bc95d61ef32fe1e3d8ba215bc3 | |
parent | 7fa990edc6cbae05e8b68da58313fd675ac5fa81 (diff) |
Core/PetAI: Change an assert to a TC_LOG_ERROR
-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 4e18160e553..f3f0596bb65 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)) |