mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix: check loadModel return before createInstance for WMO doodads
When the M2 model cache is full (>6000 entries), loadModel() returns false and the model is never added to the GPU cache. The WMO instance doodad path was calling createInstanceWithMatrix() unconditionally, generating hundreds of "Cannot create instance: model X not loaded" warnings on zone entry. Add the same guard already present in the terrain doodad path.
This commit is contained in:
parent
863faf9b54
commit
0487d2eda6
1 changed files with 1 additions and 1 deletions
|
|
@ -4464,7 +4464,7 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float
|
|||
glm::vec3 worldPos = glm::vec3(worldMatrix[3]);
|
||||
|
||||
uint32_t doodadModelId = static_cast<uint32_t>(std::hash<std::string>{}(m2Path));
|
||||
m2Renderer->loadModel(m2Model, doodadModelId);
|
||||
if (!m2Renderer->loadModel(m2Model, doodadModelId)) continue;
|
||||
uint32_t doodadInstId = m2Renderer->createInstanceWithMatrix(doodadModelId, worldMatrix, worldPos);
|
||||
if (doodadInstId) m2Renderer->setSkipCollision(doodadInstId, true);
|
||||
loadedDoodads++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue