From a0c24e70f94062293940d0519337919cf81e05d8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 6 Feb 2026 14:37:31 -0800 Subject: [PATCH] Load creature display DBC lookups at startup instead of first spawn Moves buildCreatureDisplayLookups() from lazy init on first creature spawn to eagerly run after asset manager init, eliminating a 133s hang. --- src/core/application.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index b8b02820..d14abaa3 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -171,6 +171,8 @@ bool Application::initialize() { LOG_INFO("Attempting to load WoW assets from: ", dataPath); if (assetManager->initialize(dataPath)) { LOG_INFO("Asset manager initialized successfully"); + // Eagerly load creature display DBC lookups so first spawn doesn't stall + buildCreatureDisplayLookups(); } else { LOG_WARNING("Failed to initialize asset manager - asset loading will be unavailable"); LOG_WARNING("Set WOW_DATA_PATH environment variable to your WoW Data directory"); @@ -1842,10 +1844,8 @@ std::string Application::getModelPathForDisplayId(uint32_t displayId) const { void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x, float y, float z, float orientation) { if (!renderer || !renderer->getCharacterRenderer() || !assetManager) return; - // Build lookups on first creature spawn - if (!creatureLookupsBuilt_) { - buildCreatureDisplayLookups(); - } + // Skip if lookups not yet built (asset manager not ready) + if (!creatureLookupsBuilt_) return; // Skip if already spawned if (creatureInstances_.count(guid)) return;