Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index a56e1dc..6629ca9 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -556,7 +556,9 @@ void draw_model_fragments(core::Entity *entity)
if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) {
- if (static_cast<core::EntityDynamic *>(entity)->state() == core::Entity::NoPower) {
+ int state = static_cast<core::EntityDynamic *>(entity)->state();
+
+ if ((state == core::Entity::NoPower) || (state == core::Entity::Destroyed)) {
power = false;
} else if (entity->type() == core::Entity::Controlable) {
@@ -760,12 +762,12 @@ void draw_pass_model_fx(float elapsed)
power = true;
- if ((entity->type() == core::Entity::Dynamic) &&
- (static_cast<core::EntityDynamic *>(entity)->state() == core::Entity::NoPower)) {
- power = false;
- } else if ((entity->type() == core::Entity::Controlable) &&
- (static_cast<core::EntityControlable *>(entity)->state() == core::Entity::NoPower)) {
- power = false;
+ if ((entity->type() == core::Entity::Controlable) || (entity->type() == core::Entity::Dynamic)) {
+ int state = static_cast<core::EntityDynamic *>(entity)->state();
+
+ if ((state == core::Entity::NoPower) || (state == core::Entity::Destroyed)) {
+ power = false;
+ }
}
if (entity->model() && ext_render(entity)->detailvisible() && power) {