diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/view.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index 7038a47..56c692e 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -61,7 +61,7 @@ void init() cl_crosshaircolor = core::Cvar::get("cl_crosshaircolor", "1 1 1", core::Cvar::Archive); cl_crosshaircolor->set_info("[r g b] crosshairs color"); - snd_engines = core::Cvar::get("snd_engines", "0", core::Cvar::Archive); + snd_engines = core::Cvar::get("snd_engines", "1", core::Cvar::Archive); snd_engines->set_info("[bool] enable or disable engine sounds"); } @@ -294,12 +294,13 @@ void render_sound() if (!(snd_engines && snd_engines->value())) return; - float speed = 0; + math::Vector3f velocity(0, 0 ,0); + if (core::localcontrol()) { - speed = core::localcontrol()->speed(); + velocity.assign(core::localcontrol()->state()->axis().forward() * core::localcontrol()->speed()); } - audio::update_listener(render::Camera::eye(), render::Camera::axis(), speed); + audio::update_listener(render::Camera::eye(), render::Camera::axis(), velocity); for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { core::Entity *entity = (*it).second; |