Michael Danilov: Fix issue #2169 Sound with condition=false will play when moving into its max-dist (patch available)
This commit is contained in:
parent
a157e50302
commit
631fa62495
@ -343,7 +343,7 @@ public:
|
||||
* Schedule this audio sample to stop (or start) playing.
|
||||
*/
|
||||
inline void set_out_of_range(bool oor = true) {
|
||||
_out_of_range = oor; _playing = (!oor && _loop); _changed = true;
|
||||
_out_of_range = oor; _changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,9 @@ SGXmlSound::update (double dt)
|
||||
// else
|
||||
// if a property is defined then test if it's value is FALSE
|
||||
// or if the mode is IN_TRANSIT then
|
||||
// test whether the current value matches the previous value.
|
||||
// test whether the current value matches the previous value,
|
||||
// else
|
||||
// check if out of range.
|
||||
if ( // Lisp, anyone?
|
||||
(_condition && !_condition->test()) ||
|
||||
(!_condition && _property &&
|
||||
@ -355,7 +357,8 @@ SGXmlSound::update (double dt)
|
||||
!curr_value ||
|
||||
( (_mode == SGXmlSound::IN_TRANSIT) && (curr_value == _prev_value) )
|
||||
)
|
||||
)
|
||||
) ||
|
||||
_sample->test_out_of_range()
|
||||
)
|
||||
{
|
||||
if ((_mode != SGXmlSound::IN_TRANSIT) || (_stopping > MAX_TRANSIT_TIME))
|
||||
|
Loading…
Reference in New Issue
Block a user