Skip to content

Commit 73bb170

Browse files
committed
Merge branch 'getsoundplaying' into 'master'
Don't require a reference for GetSoundPlaying (#8389) Closes #8389 See merge request OpenMW/openmw!4576
2 parents a49a900 + 8cb1838 commit 73bb170

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/openmw/mwscript/soundextensions.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,17 @@ namespace MWScript
162162
public:
163163
void execute(Interpreter::Runtime& runtime) override
164164
{
165-
MWWorld::Ptr ptr = R()(runtime);
165+
MWWorld::Ptr ptr = R()(runtime, false);
166166

167167
int index = runtime[0].mInteger;
168168
runtime.pop();
169169

170+
if (ptr.isEmpty())
171+
{
172+
runtime.push(0);
173+
return;
174+
}
175+
170176
bool ret = MWBase::Environment::get().getSoundManager()->getSoundPlaying(
171177
ptr, ESM::RefId::stringRefId(runtime.getStringLiteral(index)));
172178

0 commit comments

Comments
 (0)