| 2112 | } |
| 2113 | |
| 2114 | void ShapeBase::updateAudioState(Sound& st) |
| 2115 | { |
| 2116 | SFX_DELETE( st.sound ); |
| 2117 | |
| 2118 | if ( st.play && st.profile ) |
| 2119 | { |
| 2120 | if ( isGhost() ) |
| 2121 | { |
| 2122 | if ( Sim::findObject( SimObjectId((uintptr_t)st.profile), st.profile ) ) |
| 2123 | { |
| 2124 | st.sound = SFX->createSource( st.profile, &getTransform() ); |
| 2125 | if ( st.sound ) |
| 2126 | st.sound->play(); |
| 2127 | } |
| 2128 | else |
| 2129 | st.play = false; |
| 2130 | } |
| 2131 | else |
| 2132 | { |
| 2133 | // Non-looping sounds timeout on the server |
| 2134 | st.timeout = 0; |
| 2135 | if ( !st.profile->getDescription()->mIsLooping ) |
| 2136 | st.timeout = Sim::getCurrentTime() + sAudioTimeout; |
| 2137 | } |
| 2138 | } |
| 2139 | else |
| 2140 | st.play = false; |
| 2141 | } |
| 2142 | |
| 2143 | void ShapeBase::updateAudioPos() |
| 2144 | { |
nothing calls this directly
no test coverage detected