summaryrefslogtreecommitdiff
path: root/modules/sparkler/particles.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sparkler/particles.c')
-rw-r--r--modules/sparkler/particles.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/sparkler/particles.c b/modules/sparkler/particles.c
index bb431a6..69f55dd 100644
--- a/modules/sparkler/particles.c
+++ b/modules/sparkler/particles.c
@@ -260,7 +260,8 @@ static inline particle_status_t _particles_sim(particles_t *particles, list_head
if ((s = particle_sim(particles, &p->public)) == PARTICLE_ALIVE) {
ret = PARTICLE_ALIVE;
- if (_particles_sim(particles, &p->children) == PARTICLE_ALIVE) {
+ if (!list_empty(&p->children) &&
+ _particles_sim(particles, &p->children) == PARTICLE_ALIVE) {
ret = PARTICLE_ALIVE;
}
} else {
@@ -326,7 +327,9 @@ static inline void _particles_age(particles_t *particles, list_head_t *list)
bsp_move_occupant(particles->bsp, &p->public.occupant, &p->props.position);
}
- _particles_age(particles, &p->children);
+ if (!list_empty(&p->children)) {
+ _particles_age(particles, &p->children);
+ }
}
}
© All Rights Reserved