diff --git a/src/C4Script.cpp b/src/C4Script.cpp index 8462ac39..8b745fdf 100644 --- a/src/C4Script.cpp +++ b/src/C4Script.cpp @@ -2457,13 +2457,13 @@ static bool FnSound(C4AulContext *cthr, C4String *szSound, bool fGlobal, C4Objec return true; // try to play effect C4SoundSystem::TargetVariant target; - if (fGlobal) + if (pObj) { - target.emplace(&cthr->GetSection()); + target.emplace(pObj); } else { - target.emplace(pObj); + target.emplace(&cthr->GetSection()); } if (iLoop >= 0) StartSoundEffect(FnStringPar(szSound), !!iLoop, iLevel, target, iCustomFalloffDistance);