mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
Clear game handler DBC caches on expansion switch
Add resetDbcCaches() to GameHandler to clear stale spell name, skill, taxi, and talent caches when switching expansions. Called from reloadExpansionData() so switching servers (e.g. WotLK to Turtle) reloads DBC data instead of using stale entries from the previous expansion.
This commit is contained in:
parent
53e5aff4d2
commit
35d91ebfe1
3 changed files with 29 additions and 0 deletions
|
|
@ -800,6 +800,12 @@ public:
|
|||
*/
|
||||
void update(float deltaTime);
|
||||
|
||||
/**
|
||||
* Reset DBC-backed caches so they reload from new expansion data.
|
||||
* Called by Application when the expansion profile changes.
|
||||
*/
|
||||
void resetDbcCaches();
|
||||
|
||||
private:
|
||||
void autoTargetAttacker(uint64_t attackerGuid);
|
||||
|
||||
|
|
|
|||
|
|
@ -516,6 +516,11 @@ void Application::reloadExpansionData() {
|
|||
// Reset map name cache so it reloads from new expansion's Map.dbc
|
||||
mapNameCacheLoaded_ = false;
|
||||
mapNameById_.clear();
|
||||
|
||||
// Reset game handler DBC caches so they reload from new expansion data
|
||||
if (gameHandler) {
|
||||
gameHandler->resetDbcCaches();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::logoutToLogin() {
|
||||
|
|
|
|||
|
|
@ -220,6 +220,24 @@ void GameHandler::disconnect() {
|
|||
LOG_INFO("Disconnected from world server");
|
||||
}
|
||||
|
||||
void GameHandler::resetDbcCaches() {
|
||||
spellNameCacheLoaded_ = false;
|
||||
spellNameCache_.clear();
|
||||
skillLineDbcLoaded_ = false;
|
||||
skillLineNames_.clear();
|
||||
skillLineCategories_.clear();
|
||||
skillLineAbilityLoaded_ = false;
|
||||
spellToSkillLine_.clear();
|
||||
taxiDbcLoaded_ = false;
|
||||
taxiNodes_.clear();
|
||||
taxiPathEdges_.clear();
|
||||
taxiPathNodes_.clear();
|
||||
talentDbcLoaded_ = false;
|
||||
talentCache_.clear();
|
||||
talentTabCache_.clear();
|
||||
LOG_INFO("GameHandler: DBC caches cleared for expansion switch");
|
||||
}
|
||||
|
||||
bool GameHandler::isConnected() const {
|
||||
return socket && socket->isConnected();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue