From 697b494a30f8b17090b347ca99a86b93fd6a6319 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 24 Feb 2012 19:34:29 +0000 Subject: Fix for #30336: Couldn't playback from Python without having played back via logic bricks once. Thanks Colin Nickerson for reporting. --- source/gameengine/Ketsji/KX_SoundActuator.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'source/gameengine') diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index c47c45df4ac..5c4cb7216dd 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -325,18 +325,15 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound, "startSound()\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_PAUSED: - m_handle->resume(); - break; - default: - play(); - } + case AUD_STATUS_PLAYING: + break; + case AUD_STATUS_PAUSED: + m_handle->resume(); + break; + default: + play(); } Py_RETURN_NONE; } -- cgit v1.2.3