diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index af19abe..3be18e7 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -572,15 +572,23 @@ void draw_model_fragments(core::Entity *entity) bool use_color_array = true; // glEnableClientState(GL_COLOR_ARRAY) is set bool use_light = true; // gl::disable(GL_LIGHTING) is set + bool power = true; float thrust = 0; - if (entity->type() == core::Entity::Controlable) { - thrust = static_cast<core::EntityControlable *>(entity)->thrust(); - } - bool power = true; if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) { - if ((static_cast<core::EntityDynamic *>(entity)->eventstate() & core::Entity::NoPower) == core::Entity::NoPower) { + + if (static_cast<core::EntityDynamic *>(entity)->eventstate() == core::Entity::NoPower) { power = false; + + } else if (entity->type() == core::Entity::Controlable) { + + core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity); + + if (ec->eventstate() == core::Entity::Impulse) { + thrust = 1.0f; + } else { + thrust = ec->thrust(); + } } } @@ -631,12 +639,12 @@ void draw_model_fragments(core::Entity *entity) } } - if (power && material & Material::Light) { + if (power && (material & Material::Light)) { if (use_light) { gl::disable(GL_LIGHTING); use_light = false; } - } else if ( power && material & Material::Engine) { + } else if (power && (material & Material::Engine)) { if (use_light) { gl::disable(GL_LIGHTING); use_light = false; |