Fix aliveness check for emitter

Emitter aliveness should be checked with its finish state

Also update bubbling to re-activate an still alive handle
scene_man
En Yi 2023-11-20 22:47:30 +08:00
parent 911663b51f
commit f94ecedc7d
2 changed files with 5 additions and 1 deletions

View File

@ -130,7 +130,7 @@ bool is_emitter_handle_alive(ParticleSystem_t* system, EmitterHandle handle)
{
if (handle == 0) return false;
return system->emitters[handle].active;
return !system->emitters[handle].finished;
}
EmitterHandle play_particle_emitter(ParticleSystem_t* system, const ParticleEmitter_t* in_emitter)

View File

@ -1495,6 +1495,10 @@ void state_transition_update_system(Scene_t* scene)
};
p_emitter->handle = play_particle_emitter(&scene->part_sys, &emitter);
}
else
{
play_emitter_handle(&scene->part_sys, p_emitter->handle);
}
}
}
}