From 283a59e352d252e03793abec8d5e59ab50497f0c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 9 Feb 2013 11:16:24 +0000 Subject: Disable particle system ejectors for EntityDynamic in Entity::NoPower state. --- src/render/particlesystem.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/render') diff --git a/src/render/particlesystem.cc b/src/render/particlesystem.cc index e041479..87cb7bc 100644 --- a/src/render/particlesystem.cc +++ b/src/render/particlesystem.cc @@ -175,9 +175,18 @@ void ParticleSystem::draw(const float seconds) ejector_active = false; break; } - ejector->enable(ejector_active); + } + + } else if (entity()->type() == core::Entity::Dynamic) { + + const core::EntityDynamic *dynamic = static_cast(entity()); + if (dynamic->state() == core::Entity::NoPower) { + ejector_active = false; } } + + ejector->enable(ejector_active); + } (*it)->frame(seconds, current_location, current_axis * ejector->axis()); -- cgit v1.2.3