Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/soundext.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client/soundext.cc b/src/client/soundext.cc
index 09c83d8..dd86a70 100644
--- a/src/client/soundext.cc
+++ b/src/client/soundext.cc
@@ -295,6 +295,18 @@ void SoundExt::frame(float elapsed)
pitch = 1.0f;
gain = 0.0f; // loop buffer gain
+ } else if (controlable->state() == core::Entity::Docked) {
+
+ if (state_engineloopbuffer) {
+ audio::stop(state_engineloopsource);
+ state_engineloopbuffer = 0;
+ }
+ if (state_engineeventbuffer) {
+ audio::stop(state_engineeventsource);
+ state_engineeventbuffer = 0;
+ }
+ gain = 0.0f; // loop buffer gain
+
} else {
if ((state_engineeventbuffer == state_impulsestartbuffer) || (state_engineeventbuffer == state_impulseloopbuffer)) {
@@ -310,11 +322,13 @@ void SoundExt::frame(float elapsed)
}
}
- audio::update_source(state_engineloopsource,
- controlable->location() - controlable->axis().forward() * r ,velocity, pitch, gain);
+ if (state_engineloopbuffer) {
+ audio::update_source(state_engineloopsource, controlable->location() - controlable->axis().forward() * r ,velocity, pitch, gain);
+ }
- audio::update_source(state_engineeventsource,
- controlable->location() - controlable->axis().forward() * r , velocity);
+ if (state_engineeventbuffer) {
+ audio::update_source(state_engineeventsource, controlable->location() - controlable->axis().forward() * r , velocity);
+ }
} else if (entity()->type() == core::Entity::Dynamic) {