mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: allow ribbon-only M2 models to load and silence transport doodad load errors
Two follow-up fixes for the ribbon emitter implementation and the
transport-doodad stall fix:
1. loadModel() rejected any M2 with no vertices AND no particles, but
ribbon-only spell-effect models (e.g. weapon trail or aura ribbons)
have neither. These models were silently invisible even though the
ribbon rendering pipeline added in 1108aa9 is fully capable of
rendering them. Extended the guard to also accept models that have
ribbon emitters, matching the particle-emitter precedent.
2. processPendingTransportDoodads() ignored the bool return of
loadModel(), calling createInstance() even when the model was
rejected, generating spurious "Cannot create instance: model X not
loaded" warnings for every failed doodad path. Check the return
value and continue to the next doodad on failure.
This commit is contained in:
parent
f855327054
commit
d58c55ce8d
2 changed files with 4 additions and 3 deletions
|
|
@ -8247,7 +8247,7 @@ void Application::processPendingTransportDoodads() {
|
|||
}
|
||||
if (!m2Model.isValid()) continue;
|
||||
|
||||
m2Renderer->loadModel(m2Model, doodadModelId);
|
||||
if (!m2Renderer->loadModel(m2Model, doodadModelId)) continue;
|
||||
uint32_t m2InstanceId = m2Renderer->createInstance(doodadModelId, glm::vec3(0.0f), glm::vec3(0.0f), 1.0f);
|
||||
if (m2InstanceId == 0) continue;
|
||||
m2Renderer->setSkipCollision(m2InstanceId, true);
|
||||
|
|
|
|||
|
|
@ -944,8 +944,9 @@ bool M2Renderer::loadModel(const pipeline::M2Model& model, uint32_t modelId) {
|
|||
|
||||
bool hasGeometry = !model.vertices.empty() && !model.indices.empty();
|
||||
bool hasParticles = !model.particleEmitters.empty();
|
||||
if (!hasGeometry && !hasParticles) {
|
||||
LOG_WARNING("M2 model has no geometry and no particles: ", model.name);
|
||||
bool hasRibbons = !model.ribbonEmitters.empty();
|
||||
if (!hasGeometry && !hasParticles && !hasRibbons) {
|
||||
LOG_WARNING("M2 model has no renderable content: ", model.name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue