Core/Creatures: Move creature difficulty specific data from creature_template table to creature_template_difficulty (#28931)

This commit is contained in:
Meji
2023-05-29 00:01:23 +02:00
committed by GitHub
parent 526b16fea4
commit 06d0b16f15
30 changed files with 95916 additions and 549 deletions

View File

@@ -23,6 +23,7 @@
#include "GameTime.h"
#include "Item.h"
#include "Log.h"
#include "Map.h"
#include "NPCHandler.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
@@ -72,11 +73,15 @@ void WorldSession::HandleCreatureQuery(WorldPackets::Query::QueryCreature& packe
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(packet.CreatureID))
{
TC_LOG_DEBUG("network", "WORLD: CMSG_QUERY_CREATURE '{}' - Entry: {}.", ci->Name, packet.CreatureID);
if (sWorld->getBoolConfig(CONFIG_CACHE_DATA_QUERIES))
Difficulty difficulty = _player->GetMap()->GetDifficultyID();
// Cache only exists for difficulty base
if (sWorld->getBoolConfig(CONFIG_CACHE_DATA_QUERIES) && difficulty == DIFFICULTY_NONE)
SendPacket(&ci->QueryData[static_cast<uint32>(GetSessionDbLocaleIndex())]);
else
{
WorldPacket response = ci->BuildQueryData(GetSessionDbLocaleIndex());
WorldPacket response = ci->BuildQueryData(GetSessionDbLocaleIndex(), difficulty);
SendPacket(&response);
}
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUERY_CREATURE_RESPONSE");