mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-02 07:21:34 +00:00
[Client] Always play ObjectSound at position of relevant object
This commit is contained in:
parent
51861c767f
commit
b5e20d3701
1 changed files with 3 additions and 15 deletions
|
@ -881,21 +881,9 @@ void ObjectList::playObjectSounds(MWWorld::CellStore* cellStore)
|
|||
if (ptrFound)
|
||||
{
|
||||
LOG_APPEND(TimedLog::LOG_VERBOSE, "- Playing sound %s on %s", baseObject.soundId.c_str(), objectDescription.c_str());
|
||||
bool playAtPosition = false;
|
||||
if (ptrFound.isInCell()) {
|
||||
ESM::CellId localCell = Main::get().getLocalPlayer()->cell.getCellId();
|
||||
ESM::CellId soundCell = ptrFound.getCell()->getCell()->getCellId();
|
||||
playAtPosition = localCell == soundCell;
|
||||
}
|
||||
|
||||
if (playAtPosition) {
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptrFound.getRefData().getPosition().asVec3(),
|
||||
baseObject.soundId, baseObject.volume, baseObject.pitch, MWSound::Type::Sfx, MWSound::PlayMode::Normal, 0);
|
||||
}
|
||||
else {
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptrFound,
|
||||
baseObject.soundId, baseObject.volume, baseObject.pitch, MWSound::Type::Sfx, MWSound::PlayMode::Normal, 0);
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptrFound.getRefData().getPosition().asVec3(),
|
||||
baseObject.soundId, baseObject.volume, baseObject.pitch, MWSound::Type::Sfx, MWSound::PlayMode::Normal, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue