diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/view.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index 56c692e..34fe3fa 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -315,8 +315,16 @@ void render_sound() float pitch = 0.2f + entitycontrolable->thrust() * 0.8f; if (!state->state_enginesound) { - if ((state->state_enginesound = audio::Sources::get()) > 0 ) - audio::loop(state->state_enginesound, "engines/loop01", pitch, 0); + if ((state->state_enginesound = audio::Sources::get()) > 0 ) { + + size_t enginesound = 0; + if (entity->model()) + enginesound = entity->model()->enginesound(); + + std::stringstream soundname; + soundname << "engines/loop" << std::setfill('0') << std::setw(2) << enginesound; + audio::loop(state->state_enginesound, soundname.str().c_str(), pitch, 0); + } } if (state->state_enginesound) { |