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

Merge branch 'getsoundplaying' into 'master'

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

Closes #8389

See merge request OpenMW/openmw!4576
This commit is contained in:
Alexei Kotov 2025-03-09 15:52:00 +03:00
commit 1a7e8850f7

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)));