From ce32ccfad5572f70a9cfbd80a4a3b6f8b3646392 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 2 Jul 2011 14:45:00 +0000 Subject: Dont' draw the player's ship in Cockpit view, don't let engine sound depend on entity visibility. --- src/client/soundext.cc | 3 ++- src/render/renderext.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/soundext.cc b/src/client/soundext.cc index e9d2deb..fbed639 100644 --- a/src/client/soundext.cc +++ b/src/client/soundext.cc @@ -55,10 +55,11 @@ void render_entity_sound(core::Entity *entity) return; } - if (!ext_render(entity) || (ext_render(entity) && !ext_render(entity)->visible())) { + if (!ext_render(entity) || (ext_render(entity)->distance() > core::range::fxdistance) || (!ext_render(entity)->power())) { if (ext_sound(entity)) delete ext_sound(entity); return; + } else { if (!ext_sound(entity)) { new SoundExt(entity); diff --git a/src/render/renderext.cc b/src/render/renderext.cc index 8ec31bf..51b7976 100644 --- a/src/render/renderext.cc +++ b/src/render/renderext.cc @@ -136,12 +136,12 @@ void RenderExt::frame(float elapsed) state_visible = false; return; } -/* + if ((controlable == core::localcontrol()) && (Camera::mode() == Camera::Cockpit)) { state_visible = false; return; } -*/ + if ((controlable->state() == core::Entity::NoPower) || (controlable->state() == core::Entity::Destroyed)) { state_power = false; } -- cgit v1.2.3