1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-14 01:19:59 +00:00

Don't require a reference for GetSoundPlaying (#8389)

This commit is contained in:
Alexei Kotov 2025-03-09 00:52:00 +03:00
parent 5f92d520ee
commit 8cb1838c4a

View File

@ -162,11 +162,17 @@ namespace MWScript
public:
void execute(Interpreter::Runtime& runtime) override
{
MWWorld::Ptr ptr = R()(runtime);
MWWorld::Ptr ptr = R()(runtime, false);
int index = runtime[0].mInteger;
runtime.pop();
if (ptr.isEmpty())
{
runtime.push(0);
return;
}
bool ret = MWBase::Environment::get().getSoundManager()->getSoundPlaying(
ptr, ESM::RefId::stringRefId(runtime.getStringLiteral(index)));