mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 22:53:53 +00:00
SoundGen fix: use Original Creature field only if non-empty
This commit is contained in:
parent
88a2e4c043
commit
192626c6f5
1 changed files with 3 additions and 2 deletions
|
@ -679,14 +679,15 @@ namespace MWClass
|
|||
if(type >= 0)
|
||||
{
|
||||
std::vector<const ESM::SoundGenerator*> sounds;
|
||||
sounds.reserve(8);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = ptr.get<ESM::Creature>();
|
||||
|
||||
const std::string& ourId = (ref->mBase->mOriginal.empty()) ? getId(ptr) : ref->mBase->mOriginal;
|
||||
|
||||
MWWorld::Store<ESM::SoundGenerator>::iterator sound = store.begin();
|
||||
while(sound != store.end())
|
||||
{
|
||||
if (type == sound->mType && !sound->mCreature.empty() && Misc::StringUtils::ciEqual(ref->mBase->mOriginal, sound->mCreature))
|
||||
if (type == sound->mType && !sound->mCreature.empty() && (Misc::StringUtils::ciEqual(ourId, sound->mCreature)))
|
||||
sounds.push_back(&*sound);
|
||||
++sound;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue