mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Entities/Unit: Finally fix no-path evasion.
- When a creature cannot find a path to its victim, it begins evading all attacks and regenerating health. - If this persists for 5 seconds, it evades back to spawn position with new EvadeReason value EVADE_REASON_NO_PATH. - Also some SmartAI cleanup (why oh why does it have so much duplicated code) and getting rid of #defines in favor of type-checked compile-time constants.
This commit is contained in:
@@ -133,10 +133,10 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recvData)
|
||||
|
||||
CreatureQuestItemList const* items = sObjectMgr->GetCreatureQuestItemList(entry);
|
||||
if (items)
|
||||
for (size_t i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
|
||||
for (uint32 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
|
||||
data << (i < items->size() ? uint32((*items)[i]) : uint32(0));
|
||||
else
|
||||
for (size_t i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
|
||||
for (uint32 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
|
||||
data << uint32(0);
|
||||
|
||||
data << uint32(ci->movementId); // CreatureMovementInfo.dbc
|
||||
|
||||
Reference in New Issue
Block a user