Fix for #30336: Couldn't playback from Python without having played back via logic bricks once.

Thanks Colin Nickerson for reporting.
This commit is contained in:
Joerg Mueller 2012-02-24 19:34:29 +00:00
parent 2377bfe32f
commit 697b494a30

@ -325,18 +325,15 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound,
"startSound()\n" "startSound()\n"
"\tStarts the sound.\n") "\tStarts the sound.\n")
{ {
if(!m_handle.isNull()) switch(m_handle.isNull() ? AUD_STATUS_INVALID : m_handle->getStatus())
{ {
switch(m_handle->getStatus()) case AUD_STATUS_PLAYING:
{ break;
case AUD_STATUS_PLAYING: case AUD_STATUS_PAUSED:
break; m_handle->resume();
case AUD_STATUS_PAUSED: break;
m_handle->resume(); default:
break; play();
default:
play();
}
} }
Py_RETURN_NONE; Py_RETURN_NONE;
} }