1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Use the Original Creature field for SoundGen lookups

This commit is contained in:
scrawl 2014-12-12 01:24:35 +01:00
parent 2601b26217
commit f42420bc19

View File

@ -675,13 +675,12 @@ namespace MWClass
std::vector<const ESM::SoundGenerator*> sounds;
sounds.reserve(8);
std::string ptrid = Creature::getId(ptr);
MWWorld::LiveCellRef<ESM::Creature>* ref = ptr.get<ESM::Creature>();
MWWorld::Store<ESM::SoundGenerator>::iterator sound = store.begin();
while(sound != store.end())
{
if(type == sound->mType && !sound->mCreature.empty() &&
Misc::StringUtils::ciEqual(ptrid.substr(0, sound->mCreature.size()),
sound->mCreature))
if (type == sound->mType && !sound->mCreature.empty() && Misc::StringUtils::ciEqual(ref->mBase->mOriginal, sound->mCreature))
sounds.push_back(&*sound);
++sound;
}