1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-19 16:11:34 +00:00

removed clear() function, the only way to change the Id from the outside is from the assignment operator

replaced ciEqual with == operator
This commit is contained in:
fteppe 2022-10-03 14:02:59 +02:00 committed by florent.teppe
parent ee941f9b09
commit c8bb733360
74 changed files with 184 additions and 191 deletions

View file

@ -169,7 +169,7 @@ namespace MWClass
++sound) ++sound)
{ {
if (type == sound->mType && !sound->mCreature.empty() if (type == sound->mType && !sound->mCreature.empty()
&& (ESM::RefId::ciEqual(*creatureId, sound->mCreature))) && (*creatureId == sound->mCreature))
sounds.push_back(&*sound); sounds.push_back(&*sound);
if (type == sound->mType && sound->mCreature.empty()) if (type == sound->mType && sound->mCreature.empty())
fallbacksounds.push_back(&*sound); fallbacksounds.push_back(&*sound);

View file

@ -284,7 +284,7 @@ namespace MWClass
const MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>(); const MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>();
ESM::Armor newItem = *ref->mBase; ESM::Armor newItem = *ref->mBase;
newItem.mId.clear(); newItem.mId = ESM::RefId::sEmpty;
newItem.mName = newName; newItem.mName = newName;
newItem.mData.mEnchant = enchCharge; newItem.mData.mEnchant = enchCharge;
newItem.mEnchant = enchId; newItem.mEnchant = enchId;

View file

@ -146,7 +146,7 @@ namespace MWClass
const MWWorld::LiveCellRef<ESM::Book>* ref = ptr.get<ESM::Book>(); const MWWorld::LiveCellRef<ESM::Book>* ref = ptr.get<ESM::Book>();
ESM::Book newItem = *ref->mBase; ESM::Book newItem = *ref->mBase;
newItem.mId.clear(); newItem.mId = ESM::RefId::sEmpty;
newItem.mName = newName; newItem.mName = newName;
newItem.mData.mIsScroll = 1; newItem.mData.mIsScroll = 1;
newItem.mData.mEnchant = enchCharge; newItem.mData.mEnchant = enchCharge;

View file

@ -192,7 +192,7 @@ namespace MWClass
const MWWorld::LiveCellRef<ESM::Clothing>* ref = ptr.get<ESM::Clothing>(); const MWWorld::LiveCellRef<ESM::Clothing>* ref = ptr.get<ESM::Clothing>();
ESM::Clothing newItem = *ref->mBase; ESM::Clothing newItem = *ref->mBase;
newItem.mId.clear(); newItem.mId = ESM::RefId::sEmpty;
newItem.mName = newName; newItem.mName = newName;
newItem.mData.mEnchant = enchCharge; newItem.mData.mEnchant = enchCharge;
newItem.mEnchant = enchId; newItem.mEnchant = enchId;

View file

@ -266,7 +266,7 @@ namespace MWClass
{ {
text += MWGui::ToolTips::getCellRefString(ptr.getCellRef()); text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script"); text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
if (ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("stolen_goods"))) if (ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("stolen_goods"))
text += "\nYou can not use evidence chests"; text += "\nYou can not use evidence chests";
} }

View file

@ -649,7 +649,7 @@ namespace MWClass
while (sound != store.get<ESM::SoundGenerator>().end()) while (sound != store.get<ESM::SoundGenerator>().end())
{ {
if (type == sound->mType && !sound->mCreature.empty() if (type == sound->mType && !sound->mCreature.empty()
&& ESM::RefId::ciEqual(ourId, sound->mCreature)) && ourId == sound->mCreature)
sounds.push_back(&*sound); sounds.push_back(&*sound);
if (type == sound->mType && sound->mCreature.empty()) if (type == sound->mType && sound->mCreature.empty())
fallbacksounds.push_back(&*sound); fallbacksounds.push_back(&*sound);
@ -673,7 +673,7 @@ namespace MWClass
while (sound != store.get<ESM::SoundGenerator>().end()) while (sound != store.get<ESM::SoundGenerator>().end())
{ {
if (type == sound->mType && !sound->mCreature.empty() if (type == sound->mType && !sound->mCreature.empty()
&& ESM::RefId::ciEqual(fallbackId, sound->mCreature)) && fallbackId == sound->mCreature)
sounds.push_back(&*sound); sounds.push_back(&*sound);
++sound; ++sound;
} }

View file

@ -35,11 +35,11 @@ namespace MWClass
bool Miscellaneous::isGold(const MWWorld::ConstPtr& ptr) const bool Miscellaneous::isGold(const MWWorld::ConstPtr& ptr) const
{ {
return ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_001")) return ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_001")
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_005")) || ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_005")
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_010")) || ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_010")
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_025")) || ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_025")
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_100")); || ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_100");
} }
void Miscellaneous::insertObjectRendering( void Miscellaneous::insertObjectRendering(
@ -97,7 +97,7 @@ namespace MWClass
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul; float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
// for Azura's star add the unfilled value // for Azura's star add the unfilled value
if (ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("Misc_SoulGem_Azura"))) if (ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("Misc_SoulGem_Azura"))
value += soulValue; value += soulValue;
else else
value = soulValue; value = soulValue;

View file

@ -264,7 +264,7 @@ namespace MWClass
const MWWorld::LiveCellRef<ESM::Weapon>* ref = ptr.get<ESM::Weapon>(); const MWWorld::LiveCellRef<ESM::Weapon>* ref = ptr.get<ESM::Weapon>();
ESM::Weapon newItem = *ref->mBase; ESM::Weapon newItem = *ref->mBase;
newItem.mId.clear(); newItem.mId = ESM::RefId::sEmpty;
newItem.mName = newName; newItem.mName = newName;
newItem.mData.mEnchant = enchCharge; newItem.mData.mEnchant = enchCharge;
newItem.mEnchant = enchId; newItem.mEnchant = enchId;

View file

@ -138,7 +138,7 @@ namespace MWDialogue
if (actor.getClass().getCreatureStats(actor).isDead()) if (actor.getClass().getCreatureStats(actor).isDead())
return false; return false;
mLastTopic.clear(); mLastTopic = ESM::RefId::sEmpty;
// Note that we intentionally don't reset mPermanentDispositionChange // Note that we intentionally don't reset mPermanentDispositionChange
mChoice = -1; mChoice = -1;
@ -375,7 +375,7 @@ namespace MWDialogue
if (!inJournal(topicId, answer->mId)) if (!inJournal(topicId, answer->mId))
{ {
// Does this dialogue contains some actor-specific answer? // Does this dialogue contains some actor-specific answer?
if (ESM::RefId::ciEqual(answer->mActor, mActor.getCellRef().getRefId())) if (answer->mActor == mActor.getCellRef().getRefId())
topicFlags |= MWBase::DialogueManager::TopicType::Specific; topicFlags |= MWBase::DialogueManager::TopicType::Specific;
} }
else else
@ -744,7 +744,7 @@ namespace MWDialogue
auto it = faction->mReactions.begin(); auto it = faction->mReactions.begin();
for (; it != faction->mReactions.end(); ++it) for (; it != faction->mReactions.end(); ++it)
{ {
if (ESM::RefId::ciEqual(it->first, faction2)) if (it->first == faction2)
return it->second; return it->second;
} }
return 0; return 0;

View file

@ -84,7 +84,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
// actor id // actor id
if (!info.mActor.empty()) if (!info.mActor.empty())
{ {
if (!ESM::RefId::ciEqual(info.mActor, mActor.getCellRef().getRefId())) if (!(info.mActor == mActor.getCellRef().getRefId()))
return false; return false;
} }
else if (isCreature) else if (isCreature)
@ -101,7 +101,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
MWWorld::LiveCellRef<ESM::NPC>* cellRef = mActor.get<ESM::NPC>(); MWWorld::LiveCellRef<ESM::NPC>* cellRef = mActor.get<ESM::NPC>();
if (!ESM::RefId::ciEqual(info.mRace, cellRef->mBase->mRace)) if (!(info.mRace == cellRef->mBase->mRace))
return false; return false;
} }
@ -113,7 +113,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
MWWorld::LiveCellRef<ESM::NPC>* cellRef = mActor.get<ESM::NPC>(); MWWorld::LiveCellRef<ESM::NPC>* cellRef = mActor.get<ESM::NPC>();
if (!ESM::RefId::ciEqual(info.mClass, cellRef->mBase->mClass)) if (!(info.mClass == cellRef->mBase->mClass))
return false; return false;
} }
@ -131,7 +131,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
if (isCreature) if (isCreature)
return true; return true;
if (!ESM::RefId::ciEqual(mActor.getClass().getPrimaryFaction(mActor), info.mFaction)) if (!(mActor.getClass().getPrimaryFaction(mActor) == info.mFaction))
return false; return false;
// check rank // check rank
@ -536,19 +536,19 @@ bool MWDialogue::Filter::getSelectStructBoolean(const SelectWrapper& select) con
case SelectWrapper::Function_NotId: case SelectWrapper::Function_NotId:
return !ESM::RefId::ciEqual(mActor.getCellRef().getRefId(), ESM::RefId::stringRefId(select.getName())); return !(mActor.getCellRef().getRefId() == ESM::RefId::stringRefId(select.getName()));
case SelectWrapper::Function_NotFaction: case SelectWrapper::Function_NotFaction:
return !ESM::RefId::ciEqual(mActor.getClass().getPrimaryFaction(mActor), ESM::RefId::stringRefId(select.getName())); return !(mActor.getClass().getPrimaryFaction(mActor) == ESM::RefId::stringRefId(select.getName()));
case SelectWrapper::Function_NotClass: case SelectWrapper::Function_NotClass:
return !ESM::RefId::ciEqual(mActor.get<ESM::NPC>()->mBase->mClass, ESM::RefId::stringRefId(select.getName())); return !(mActor.get<ESM::NPC>()->mBase->mClass == ESM::RefId::stringRefId(select.getName()));
case SelectWrapper::Function_NotRace: case SelectWrapper::Function_NotRace:
return !ESM::RefId::ciEqual(mActor.get<ESM::NPC>()->mBase->mRace, ESM::RefId::stringRefId(select.getName())); return !(mActor.get<ESM::NPC>()->mBase->mRace == ESM::RefId::stringRefId(select.getName()));
case SelectWrapper::Function_NotCell: case SelectWrapper::Function_NotCell:
{ {
@ -562,8 +562,7 @@ bool MWDialogue::Filter::getSelectStructBoolean(const SelectWrapper& select) con
case SelectWrapper::Function_SameRace: case SelectWrapper::Function_SameRace:
return ESM::RefId::ciEqual( return mActor.get<ESM::NPC>()->mBase->mRace == player.get<ESM::NPC>()->mBase->mRace;
mActor.get<ESM::NPC>()->mBase->mRace, player.get<ESM::NPC>()->mBase->mRace);
case SelectWrapper::Function_SameFaction: case SelectWrapper::Function_SameFaction:

View file

@ -96,7 +96,7 @@ namespace MWGui
size_t count = mBirthList->getItemCount(); size_t count = mBirthList->getItemCount();
for (size_t i = 0; i < count; ++i) for (size_t i = 0; i < count; ++i)
{ {
if (ESM::RefId::ciEqual(ESM::RefId::stringRefId(*mBirthList->getItemDataAt<std::string>(i)), birthId)) if (ESM::RefId::stringRefId(*mBirthList->getItemDataAt<std::string>(i)) == birthId)
{ {
mBirthList->setIndexSelected(i); mBirthList->setIndexSelected(i);
break; break;
@ -134,7 +134,7 @@ namespace MWGui
return; return;
const ESM::RefId birthId = ESM::RefId::stringRefId(*mBirthList->getItemDataAt<std::string>(_index)); const ESM::RefId birthId = ESM::RefId::stringRefId(*mBirthList->getItemDataAt<std::string>(_index));
if (ESM::RefId::ciEqual(mCurrentBirthId, birthId)) if (mCurrentBirthId == birthId)
return; return;
mCurrentBirthId = birthId; mCurrentBirthId = birthId;
@ -168,7 +168,7 @@ namespace MWGui
mBirthList->setIndexSelected(index); mBirthList->setIndexSelected(index);
mCurrentBirthId = birthsignPair.first; mCurrentBirthId = birthsignPair.first;
} }
else if (ESM::RefId::ciEqual(birthsignPair.first, mCurrentBirthId)) else if (birthsignPair.first == mCurrentBirthId)
{ {
mBirthList->setIndexSelected(index); mBirthList->setIndexSelected(index);
} }

View file

@ -248,7 +248,7 @@ namespace MWGui
break; break;
case GM_ClassGenerate: case GM_ClassGenerate:
mGenerateClassStep = 0; mGenerateClassStep = 0;
mGenerateClass.clear(); mGenerateClass = ESM::RefId::sEmpty;
mGenerateClassSpecializations[0] = 0; mGenerateClassSpecializations[0] = 0;
mGenerateClassSpecializations[1] = 0; mGenerateClassSpecializations[1] = 0;
mGenerateClassSpecializations[2] = 0; mGenerateClassSpecializations[2] = 0;

View file

@ -157,7 +157,7 @@ namespace MWGui
size_t count = mClassList->getItemCount(); size_t count = mClassList->getItemCount();
for (size_t i = 0; i < count; ++i) for (size_t i = 0; i < count; ++i)
{ {
if (ESM::RefId::ciEqual(*mClassList->getItemDataAt<ESM::RefId>(i), classId)) if (*mClassList->getItemDataAt<ESM::RefId>(i) == classId)
{ {
mClassList->setIndexSelected(i); mClassList->setIndexSelected(i);
break; break;
@ -195,7 +195,7 @@ namespace MWGui
return; return;
const ESM::RefId* classId = mClassList->getItemDataAt<ESM::RefId>(_index); const ESM::RefId* classId = mClassList->getItemDataAt<ESM::RefId>(_index);
if (ESM::RefId::ciEqual(mCurrentClassId, *classId)) if (mCurrentClassId == *classId)
return; return;
mCurrentClassId = *classId; mCurrentClassId = *classId;
@ -234,7 +234,7 @@ namespace MWGui
mCurrentClassId = id; mCurrentClassId = id;
mClassList->setIndexSelected(index); mClassList->setIndexSelected(index);
} }
else if (ESM::RefId::ciEqual(id, mCurrentClassId)) else if (id == mCurrentClassId)
{ {
mClassList->setIndexSelected(index); mClassList->setIndexSelected(index);
} }

View file

@ -805,7 +805,7 @@ namespace MWGui
// skip different stacks of the same item, or we will get stuck as stacking/unstacking them may change their // skip different stacks of the same item, or we will get stuck as stacking/unstacking them may change their
// relative ordering // relative ordering
if (ESM::RefId::ciEqual(lastId, item.getCellRef().getRefId())) if (lastId == item.getCellRef().getRefId())
continue; continue;
lastId = item.getCellRef().getRefId(); lastId = item.getCellRef().getRefId();

View file

@ -422,7 +422,7 @@ namespace
intptr_t topicId = 0; /// \todo get rid of intptr ids intptr_t topicId = 0; /// \todo get rid of intptr ids
for (MWBase::Journal::TTopicIter i = journal->topicBegin(); i != journal->topicEnd(); ++i) for (MWBase::Journal::TTopicIter i = journal->topicBegin(); i != journal->topicEnd(); ++i)
{ {
if (ESM::RefId::ciEqual(i->first, topic)) if (i->first == topic)
topicId = intptr_t(&i->second); topicId = intptr_t(&i->second);
} }

View file

@ -144,7 +144,7 @@ namespace MWGui
else else
{ {
key->type = Type_Unassigned; key->type = Type_Unassigned;
key->id.clear(); key->id = ESM::RefId::sEmpty;
key->name.clear(); key->name.clear();
MyGUI::TextBox* textBox = key->button->createWidgetReal<MyGUI::TextBox>( MyGUI::TextBox* textBox = key->button->createWidgetReal<MyGUI::TextBox>(

View file

@ -165,13 +165,13 @@ namespace MWGui
for (unsigned int i = 0; i < mAvailableHeads.size(); ++i) for (unsigned int i = 0; i < mAvailableHeads.size(); ++i)
{ {
if (ESM::RefId::ciEqual(mAvailableHeads[i], proto.mHead)) if (mAvailableHeads[i] == proto.mHead)
mFaceIndex = i; mFaceIndex = i;
} }
for (unsigned int i = 0; i < mAvailableHairs.size(); ++i) for (unsigned int i = 0; i < mAvailableHairs.size(); ++i)
{ {
if (ESM::RefId::ciEqual(mAvailableHairs[i], proto.mHair)) if (mAvailableHairs[i] == proto.mHair)
mHairIndex = i; mHairIndex = i;
} }
@ -191,7 +191,7 @@ namespace MWGui
size_t count = mRaceList->getItemCount(); size_t count = mRaceList->getItemCount();
for (size_t i = 0; i < count; ++i) for (size_t i = 0; i < count; ++i)
{ {
if (ESM::RefId::ciEqual(ESM::RefId::stringRefId(*mRaceList->getItemDataAt<std::string>(i)), raceId)) if (ESM::RefId::stringRefId(*mRaceList->getItemDataAt<std::string>(i)) == raceId)
{ {
mRaceList->setIndexSelected(i); mRaceList->setIndexSelected(i);
break; break;
@ -293,7 +293,7 @@ namespace MWGui
return; return;
ESM::RefId raceId = ESM::RefId::stringRefId(*mRaceList->getItemDataAt<std::string>(_index)); ESM::RefId raceId = ESM::RefId::stringRefId(*mRaceList->getItemDataAt<std::string>(_index));
if (ESM::RefId::ciEqual(mCurrentRaceId, raceId)) if (mCurrentRaceId == raceId)
return; return;
mCurrentRaceId = raceId; mCurrentRaceId = raceId;
@ -334,7 +334,7 @@ namespace MWGui
&& idString[idString.size() - 2] == 's' && idString[idString.size() - 1] == 't'; && idString[idString.size() - 2] == 's' && idString[idString.size() - 1] == 't';
if (firstPerson) if (firstPerson)
continue; continue;
if (ESM::RefId::ciEqual(bodypart.mRace, mCurrentRaceId)) if (bodypart.mRace == mCurrentRaceId)
out.push_back(bodypart.mId); out.push_back(bodypart.mId);
} }
} }
@ -393,7 +393,7 @@ namespace MWGui
for (auto& item : items) for (auto& item : items)
{ {
mRaceList->addItem(item.second, item.first); mRaceList->addItem(item.second, item.first);
if (ESM::RefId::ciEqual(item.first, mCurrentRaceId)) if (item.first == mCurrentRaceId)
mRaceList->setIndexSelected(index); mRaceList->setIndexSelected(index);
++index; ++index;
} }

View file

@ -166,7 +166,7 @@ namespace MWGui
if (!mMerchant.isEmpty()) if (!mMerchant.isEmpty())
{ {
MWWorld::Ptr base = item.mBase; MWWorld::Ptr base = item.mBase;
if (ESM::RefId::ciEqual(base.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId)) if (base.getCellRef().getRefId() == MWWorld::ContainerStore::sGoldId)
continue; continue;
if (!base.getClass().showsInInventory(base)) if (!base.getClass().showsInInventory(base))

View file

@ -1344,7 +1344,7 @@ namespace MWGui
void WindowManager::setSelectedEnchantItem(const MWWorld::Ptr& item) void WindowManager::setSelectedEnchantItem(const MWWorld::Ptr& item)
{ {
mSelectedEnchantItem = item; mSelectedEnchantItem = item;
mSelectedSpell.clear(); mSelectedSpell = ESM::RefId::sEmpty;
const ESM::Enchantment* ench = mStore->get<ESM::Enchantment>().find(item.getClass().getEnchantment(item)); const ESM::Enchantment* ench = mStore->get<ESM::Enchantment>().find(item.getClass().getEnchantment(item));
int chargePercent int chargePercent
@ -1377,7 +1377,7 @@ namespace MWGui
void WindowManager::unsetSelectedSpell() void WindowManager::unsetSelectedSpell()
{ {
mSelectedSpell.clear(); mSelectedSpell = ESM::RefId::sEmpty;
mSelectedEnchantItem = MWWorld::Ptr(); mSelectedEnchantItem = MWWorld::Ptr();
mHud->unsetSelectedSpell(); mHud->unsetSelectedSpell();
@ -1770,7 +1770,7 @@ namespace MWGui
mToolTips->clear(); mToolTips->clear();
mSelectedSpell.clear(); mSelectedSpell = ESM::RefId::sEmpty;
mCustomMarkers.clear(); mCustomMarkers.clear();
mForceHidden = GW_None; mForceHidden = GW_None;

View file

@ -419,7 +419,7 @@ namespace MWMechanics
bool ActiveSpells::isSpellActive(const ESM::RefId& id) const bool ActiveSpells::isSpellActive(const ESM::RefId& id) const
{ {
return std::find_if(mSpells.begin(), mSpells.end(), [&](const auto& spell) { return std::find_if(mSpells.begin(), mSpells.end(), [&](const auto& spell) {
return ESM::RefId::ciEqual(spell.mId, id); return spell.mId == id;
}) != mSpells.end(); }) != mSpells.end();
} }

View file

@ -449,7 +449,7 @@ int MWMechanics::Alchemy::addIngredient(const MWWorld::Ptr& ingredient)
for (TIngredientsIterator iter(mIngredients.begin()); iter != mIngredients.end(); ++iter) for (TIngredientsIterator iter(mIngredients.begin()); iter != mIngredients.end(); ++iter)
if (!iter->isEmpty() if (!iter->isEmpty()
&& ESM::RefId::ciEqual(ingredient.getCellRef().getRefId(), iter->getCellRef().getRefId())) && ingredient.getCellRef().getRefId() == iter->getCellRef().getRefId())
return -1; return -1;
mIngredients[slot] = ingredient; mIngredients[slot] = ingredient;

View file

@ -56,7 +56,7 @@ namespace MWMechanics
caps.mLimit = iAutoSpellSchoolMax[i]; caps.mLimit = iAutoSpellSchoolMax[i];
caps.mReachedLimit = iAutoSpellSchoolMax[i] <= 0; caps.mReachedLimit = iAutoSpellSchoolMax[i] <= 0;
caps.mMinCost = std::numeric_limits<int>::max(); caps.mMinCost = std::numeric_limits<int>::max();
caps.mWeakestSpell.clear(); caps.mWeakestSpell = ESM::RefId::sEmpty;
schoolCaps[i] = caps; schoolCaps[i] = caps;
} }

View file

@ -371,7 +371,7 @@ namespace MWMechanics
void CreatureStats::clearLastHitObject() void CreatureStats::clearLastHitObject()
{ {
mLastHitObject.clear(); mLastHitObject = ESM::RefId::sEmpty;
} }
const ESM::RefId& CreatureStats::getLastHitObject() const const ESM::RefId& CreatureStats::getLastHitObject() const
@ -386,7 +386,7 @@ namespace MWMechanics
void CreatureStats::clearLastHitAttemptObject() void CreatureStats::clearLastHitAttemptObject()
{ {
mLastHitAttemptObject.clear(); mLastHitAttemptObject = ESM::RefId::sEmpty;
} }
const ESM::RefId& CreatureStats::getLastHitAttemptObject() const const ESM::RefId& CreatureStats::getLastHitAttemptObject() const

View file

@ -74,7 +74,7 @@ namespace MWMechanics
// Exception for Azura Star, new one will be added after enchanting // Exception for Azura Star, new one will be added after enchanting
auto azurasStarId = ESM::RefId::stringRefId("Misc_SoulGem_Azura"); auto azurasStarId = ESM::RefId::stringRefId("Misc_SoulGem_Azura");
if (ESM::RefId::ciEqual(mSoulGemPtr.get<ESM::Miscellaneous>()->mBase->mId, azurasStarId)) if (mSoulGemPtr.get<ESM::Miscellaneous>()->mBase->mId == azurasStarId)
store.add(azurasStarId, 1, player); store.add(azurasStarId, 1, player);
if (mSelfEnchanting) if (mSelfEnchanting)

View file

@ -20,7 +20,7 @@ namespace MWMechanics
T copy = *MWBase::Environment::get().getWorld()->getStore().get<T>().find(actorId); T copy = *MWBase::Environment::get().getWorld()->getStore().get<T>().find(actorId);
for (auto& it : copy.mInventory.mList) for (auto& it : copy.mInventory.mList)
{ {
if (ESM::RefId::ciEqual(it.mItem, itemId)) if (it.mItem == itemId)
{ {
const int sign = it.mCount < 1 ? -1 : 1; const int sign = it.mCount < 1 ? -1 : 1;
it.mCount = sign * std::max(it.mCount * sign + amount, 0); it.mCount = sign * std::max(it.mCount * sign + amount, 0);

View file

@ -513,7 +513,7 @@ namespace MWMechanics
const MWWorld::Store<ESM::GameSetting>& gmst const MWWorld::Store<ESM::GameSetting>& gmst
= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fDispRaceMod = gmst.find("fDispRaceMod")->mValue.getFloat(); static const float fDispRaceMod = gmst.find("fDispRaceMod")->mValue.getFloat();
if (ESM::RefId::ciEqual(npc->mBase->mRace, player->mBase->mRace)) if (npc->mBase->mRace == player->mBase->mRace)
x += fDispRaceMod; x += fDispRaceMod;
static const float fDispPersonalityMult = gmst.find("fDispPersonalityMult")->mValue.getFloat(); static const float fDispPersonalityMult = gmst.find("fDispPersonalityMult")->mValue.getFloat();
@ -913,7 +913,7 @@ namespace MWMechanics
return false; return false;
// A special case for evidence chest - we should not allow to take items even if it is technically permitted // A special case for evidence chest - we should not allow to take items even if it is technically permitted
return !ESM::RefId::ciEqual(cellref.getRefId(), ESM::RefId::stringRefId("stolen_goods")); return !(cellref.getRefId() == ESM::RefId::stringRefId("stolen_goods"));
} }
bool MechanicsManager::sleepInBed(const MWWorld::Ptr& ptr, const MWWorld::Ptr& bed) bool MechanicsManager::sleepInBed(const MWWorld::Ptr& ptr, const MWWorld::Ptr& bed)
@ -1013,7 +1013,7 @@ namespace MWMechanics
const ESM::RefId& victimFaction = victim.getClass().getPrimaryFaction(victim); const ESM::RefId& victimFaction = victim.getClass().getPrimaryFaction(victim);
if (!victimFaction.empty() if (!victimFaction.empty()
&& ESM::RefId::ciEqual(item.getCellRef().getFaction(), victimFaction)) // Is the item faction-owned? && item.getCellRef().getFaction() == victimFaction) // Is the item faction-owned?
{ {
owner.first = victimFaction; owner.first = victimFaction;
owner.second = true; owner.second = true;
@ -1118,7 +1118,7 @@ namespace MWMechanics
} }
} }
if (!ESM::RefId::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId)) if (!(item.getCellRef().getRefId() == MWWorld::ContainerStore::sGoldId))
{ {
if (victim.isEmpty() if (victim.isEmpty()
|| (victim.getClass().isActor() && victim.getRefData().getCount() > 0 || (victim.getClass().isActor() && victim.getRefData().getCount() > 0

View file

@ -99,7 +99,7 @@ namespace MWMechanics
ESM::RefId soulGemAzura = ESM::RefId::stringRefId("Misc_SoulGem_Azura"); ESM::RefId soulGemAzura = ESM::RefId::stringRefId("Misc_SoulGem_Azura");
// special case: readd Azura's Star // special case: readd Azura's Star
if (ESM::RefId::ciEqual(gem.get<ESM::Miscellaneous>()->mBase->mId, soulGemAzura)) if (gem.get<ESM::Miscellaneous>()->mBase->mId == soulGemAzura)
player.getClass().getContainerStore(player).add(soulGemAzura, 1, player); player.getClass().getContainerStore(player).add(soulGemAzura, 1, player);
} }

View file

@ -100,7 +100,7 @@ namespace MWMechanics
// try to find a new tool of the same ID // try to find a new tool of the same ID
for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter) for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter)
{ {
if (ESM::RefId::ciEqual(iter->getCellRef().getRefId(), mTool.getCellRef().getRefId())) if (iter->getCellRef().getRefId() == mTool.getCellRef().getRefId())
{ {
mTool = *iter; mTool = *iter;

View file

@ -207,7 +207,7 @@ namespace
{ {
MWWorld::InventoryStore& store = actor.getClass().getInventoryStore(actor); MWWorld::InventoryStore& store = actor.getClass().getInventoryStore(actor);
auto item = std::find_if(store.begin(), store.end(), auto item = std::find_if(store.begin(), store.end(),
[&](const auto& it) { return ESM::RefId::ciEqual(it.getCellRef().getRefId(), itemId); }); [&](const auto& it) { return it.getCellRef().getRefId() == itemId; });
if (item == store.end()) if (item == store.end())
return; return;
int slot = getBoundItemSlot(*item); int slot = getBoundItemSlot(*item);
@ -215,7 +215,7 @@ namespace
auto currentItem = store.getSlot(slot); auto currentItem = store.getSlot(slot);
bool wasEquipped bool wasEquipped
= currentItem != store.end() && ESM::RefId::ciEqual(currentItem->getCellRef().getRefId(), itemId); = currentItem != store.end() && currentItem->getCellRef().getRefId() == itemId;
if (wasEquipped) if (wasEquipped)
store.remove(*currentItem, 1, actor); store.remove(*currentItem, 1, actor);

View file

@ -77,7 +77,7 @@ namespace MWMechanics
bool changed = withBaseRecord([&](auto& spells) { bool changed = withBaseRecord([&](auto& spells) {
for (const auto& it : spells) for (const auto& it : spells)
{ {
if (ESM::RefId::ciEqual(id, it)) if (id == it)
return false; return false;
} }
spells.push_back(id); spells.push_back(id);
@ -96,7 +96,7 @@ namespace MWMechanics
bool changed = withBaseRecord([&](auto& spells) { bool changed = withBaseRecord([&](auto& spells) {
for (auto it = spells.begin(); it != spells.end(); it++) for (auto it = spells.begin(); it != spells.end(); it++)
{ {
if (ESM::RefId::ciEqual(id, *it)) if (id == *it)
{ {
spells.erase(it); spells.erase(it);
return true; return true;
@ -115,7 +115,7 @@ namespace MWMechanics
{ {
bool changed = withBaseRecord([&](auto& spells) { bool changed = withBaseRecord([&](auto& spells) {
const auto it = std::remove_if(spells.begin(), spells.end(), [&](const auto& spell) { const auto it = std::remove_if(spells.begin(), spells.end(), [&](const auto& spell) {
const auto isSpell = [&](const auto& id) { return ESM::RefId::ciEqual(spell, id); }; const auto isSpell = [&](const auto& id) { return spell == id; };
return ids.end() != std::find_if(ids.begin(), ids.end(), isSpell); return ids.end() != std::find_if(ids.begin(), ids.end(), isSpell);
}); });
if (it == spells.end()) if (it == spells.end())

View file

@ -83,7 +83,7 @@ namespace
int actorId = caster.getClass().getCreatureStats(caster).getActorId(); int actorId = caster.getClass().getCreatureStats(caster).getActorId();
const auto& active = target.getClass().getCreatureStats(target).getActiveSpells(); const auto& active = target.getClass().getCreatureStats(target).getActiveSpells();
return std::find_if(active.begin(), active.end(), [&](const auto& spell) { return std::find_if(active.begin(), active.end(), [&](const auto& spell) {
return spell.getCasterActorId() == actorId && ESM::RefId::ciEqual(spell.getId(), id); return spell.getCasterActorId() == actorId && spell.getId() == id;
}) != active.end(); }) != active.end();
} }
} }

View file

@ -82,8 +82,8 @@ namespace MWMechanics
removeSpell(spell); removeSpell(spell);
mSpellList->remove(spell); mSpellList->remove(spell);
if (ESM::RefId::ciEqual(spellId, mSelectedSpell)) if (spellId == mSelectedSpell)
mSelectedSpell.clear(); mSelectedSpell = ESM::RefId::sEmpty;
} }
void Spells::removeSpell(const ESM::Spell* spell) void Spells::removeSpell(const ESM::Spell* spell)

View file

@ -66,7 +66,7 @@ namespace
continue; continue;
if (female != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female)) if (female != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female))
continue; continue;
if (!ESM::RefId::ciEqual(bodypart.mRace, race)) if (!(bodypart.mRace == race))
continue; continue;
sVampireMapping[thisCombination] = &bodypart; sVampireMapping[thisCombination] = &bodypart;
} }
@ -1209,7 +1209,7 @@ namespace MWRender
if (bodypart.mData.mType != ESM::BodyPart::MT_Skin) if (bodypart.mData.mType != ESM::BodyPart::MT_Skin)
continue; continue;
if (!ESM::RefId::ciEqual(bodypart.mRace, race)) if (!(bodypart.mRace == race))
continue; continue;
bool partFirstPerson = isFirstPersonPart(&bodypart); bool partFirstPerson = isFirstPersonPart(&bodypart);

View file

@ -104,9 +104,9 @@ namespace MWScript
if (count == 0) if (count == 0)
return; return;
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_010")) if (item == ESM::RefId::stringRefId("gold_005") ||item == ESM::RefId::stringRefId("gold_010")
|| ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_025")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_100"))) || item == ESM::RefId::stringRefId("gold_025") ||item == ESM::RefId::stringRefId("gold_100"))
item = ESM::RefId::stringRefId("gold_001"); item = ESM::RefId::stringRefId("gold_001");
// Check if "item" can be placed in a container // Check if "item" can be placed in a container
MWWorld::ManualRef manualRef(MWBase::Environment::get().getWorld()->getStore(), item, 1); MWWorld::ManualRef manualRef(MWBase::Environment::get().getWorld()->getStore(), item, 1);
@ -191,8 +191,8 @@ namespace MWScript
ESM::RefId item = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger)); ESM::RefId item = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
runtime.pop(); runtime.pop();
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_010")) if (item == ESM::RefId::stringRefId("gold_005") ||item == ESM::RefId::stringRefId("gold_010")
|| ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_025")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_100"))) || item == ESM::RefId::stringRefId("gold_025") ||item == ESM::RefId::stringRefId("gold_100"))
item = ESM::RefId::stringRefId("gold_001"); item = ESM::RefId::stringRefId("gold_001");
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr); MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
@ -222,8 +222,8 @@ namespace MWScript
if (count == 0) if (count == 0)
return; return;
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_010")) if (item == ESM::RefId::stringRefId("gold_005") || item == ESM::RefId::stringRefId("gold_010")
|| ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_025")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_100"))) || item == ESM::RefId::stringRefId("gold_025") || item == ESM::RefId::stringRefId("gold_100"))
item = ESM::RefId::stringRefId("gold_001"); item = ESM::RefId::stringRefId("gold_001");
// Explicit calls to non-unique actors affect the base record // Explicit calls to non-unique actors affect the base record
@ -260,7 +260,7 @@ namespace MWScript
std::string_view itemName; std::string_view itemName;
for (MWWorld::ConstContainerStoreIterator iter(store.cbegin()); iter != store.cend(); ++iter) for (MWWorld::ConstContainerStoreIterator iter(store.cbegin()); iter != store.cend(); ++iter)
{ {
if (ESM::RefId::ciEqual(iter->getCellRef().getRefId(), item)) if (iter->getCellRef().getRefId() == item)
{ {
itemName = iter->getClass().getName(*iter); itemName = iter->getClass().getName(*iter);
break; break;
@ -309,7 +309,7 @@ namespace MWScript
// With soul gems we prefer filled ones. // With soul gems we prefer filled ones.
for (auto it = invStore.begin(); it != invStore.end(); ++it) for (auto it = invStore.begin(); it != invStore.end(); ++it)
{ {
if (ESM::RefId::ciEqual(it->getCellRef().getRefId(), item)) if (it->getCellRef().getRefId() == item)
{ {
found = it; found = it;
const ESM::RefId& soul = it->getCellRef().getSoul(); const ESM::RefId& soul = it->getCellRef().getSoul();
@ -425,7 +425,7 @@ namespace MWScript
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot) for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
{ {
MWWorld::ConstContainerStoreIterator it = invStore.getSlot(slot); MWWorld::ConstContainerStoreIterator it = invStore.getSlot(slot);
if (it != invStore.end() && ESM::RefId::ciEqual(it->getCellRef().getRefId(), item)) if (it != invStore.end() && it->getCellRef().getRefId() == item)
{ {
runtime.push(1); runtime.push(1);
return; return;
@ -452,7 +452,7 @@ namespace MWScript
= invStore.cbegin(MWWorld::ContainerStore::Type_Miscellaneous); = invStore.cbegin(MWWorld::ContainerStore::Type_Miscellaneous);
it != invStore.cend(); ++it) it != invStore.cend(); ++it)
{ {
if (ESM::RefId::ciEqual(it->getCellRef().getSoul(), name)) if (it->getCellRef().getSoul() == name)
count += it->getRefData().getCount(); count += it->getRefData().getCount();
} }
runtime.push(count); runtime.push(count);

View file

@ -99,7 +99,7 @@ namespace
++it; ++it;
continue; continue;
} }
if (ESM::RefId::ciEqual(itemId, it->mId)) if (itemId == it->mId)
it = list->mList.erase(it); it = list->mList.erase(it);
else else
++it; ++it;
@ -612,7 +612,7 @@ namespace MWScript
MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr); MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr);
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it) for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
{ {
if (ESM::RefId::ciEqual(it->getCellRef().getSoul(), soul)) if (it->getCellRef().getSoul() == soul)
{ {
store.remove(*it, 1, ptr); store.remove(*it, 1, ptr);
return; return;
@ -655,7 +655,7 @@ namespace MWScript
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot) for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
{ {
MWWorld::ConstContainerStoreIterator it = store.getSlot(slot); MWWorld::ConstContainerStoreIterator it = store.getSlot(slot);
if (it != store.end() && ESM::RefId::ciEqual(it->getCellRef().getRefId(), item)) if (it != store.end() && it->getCellRef().getRefId() == item)
{ {
numNotEquipped -= it->getRefData().getCount(); numNotEquipped -= it->getRefData().getCount();
} }
@ -664,7 +664,7 @@ namespace MWScript
for (int slot = 0; slot < MWWorld::InventoryStore::Slots && amount > numNotEquipped; ++slot) for (int slot = 0; slot < MWWorld::InventoryStore::Slots && amount > numNotEquipped; ++slot)
{ {
MWWorld::ContainerStoreIterator it = store.getSlot(slot); MWWorld::ContainerStoreIterator it = store.getSlot(slot);
if (it != store.end() && ESM::RefId::ciEqual(it->getCellRef().getRefId(), item)) if (it != store.end() && it->getCellRef().getRefId() == item)
{ {
int numToRemove = std::min(amount - numNotEquipped, it->getRefData().getCount()); int numToRemove = std::min(amount - numNotEquipped, it->getRefData().getCount());
store.unequipItemQuantity(*it, ptr, numToRemove); store.unequipItemQuantity(*it, ptr, numToRemove);
@ -674,7 +674,7 @@ namespace MWScript
for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter) for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter)
{ {
if (ESM::RefId::ciEqual(iter->getCellRef().getRefId(), item) if (iter->getCellRef().getRefId() == item
&& !store.isEquipped(*iter)) && !store.isEquipped(*iter))
{ {
int removed = store.remove(*iter, amount, ptr); int removed = store.remove(*iter, amount, ptr);
@ -730,7 +730,7 @@ namespace MWScript
for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter) for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter)
{ {
if (ESM::RefId::ciEqual(iter->getCellRef().getSoul(), soul)) if (iter->getCellRef().getSoul() == soul)
{ {
MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, 1); MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, 1);
store.remove(*iter, 1, ptr); store.remove(*iter, 1, ptr);
@ -953,7 +953,7 @@ namespace MWScript
runtime.pop(); runtime.pop();
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
bool hit = ESM::RefId::ciEqual(objectID, stats.getLastHitObject()); bool hit = objectID == stats.getLastHitObject();
runtime.push(hit); runtime.push(hit);
if (hit) if (hit)
stats.clearLastHitObject(); stats.clearLastHitObject();
@ -972,7 +972,7 @@ namespace MWScript
runtime.pop(); runtime.pop();
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
bool hit = ESM::RefId::ciEqual(objectID, stats.getLastHitAttemptObject()); bool hit = objectID == stats.getLastHitAttemptObject();
runtime.push(hit); runtime.push(hit);
if (hit) if (hit)
stats.clearLastHitAttemptObject(); stats.clearLastHitAttemptObject();

View file

@ -255,7 +255,7 @@ namespace MWScript
runtime.pop(); runtime.pop();
// workaround broken endgame scripts that kill dagoth ur // workaround broken endgame scripts that kill dagoth ur
if (!R::implicit && ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("dagoth_ur_1"))) if (!R::implicit && ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("dagoth_ur_1"))
{ {
runtime.push(peek); runtime.push(peek);
@ -870,7 +870,7 @@ namespace MWScript
const ESM::RefId& npcRace = ptr.get<ESM::NPC>()->mBase->mRace; const ESM::RefId& npcRace = ptr.get<ESM::NPC>()->mBase->mRace;
runtime.push(ESM::RefId::ciEqual(race, npcRace)); runtime.push(race == npcRace);
} }
}; };

View file

@ -169,7 +169,7 @@ namespace
{ {
for (auto& item : state.mInventory.mItems) for (auto& item : state.mInventory.mItems)
{ {
if (item.mCount > 0 && ESM::RefId::ciEqual(baseItem.mItem, item.mRef.mRefID)) if (item.mCount > 0 && baseItem.mItem == item.mRef.mRefID)
item.mCount = -item.mCount; item.mCount = -item.mCount;
} }
} }

View file

@ -61,7 +61,7 @@ namespace
for (MWWorld::LiveCellRef<T>& liveCellRef : list.mList) for (MWWorld::LiveCellRef<T>& liveCellRef : list.mList)
{ {
if (ESM::RefId::ciEqual(liveCellRef.mBase->mId, id) && liveCellRef.mData.getCount()) if ((liveCellRef.mBase->mId == id) && liveCellRef.mData.getCount())
{ {
MWWorld::Ptr ptr(&liveCellRef, nullptr); MWWorld::Ptr ptr(&liveCellRef, nullptr);
ptr.setContainerStore(store); ptr.setContainerStore(store);
@ -187,7 +187,7 @@ int MWWorld::ContainerStore::count(const ESM::RefId& id) const
{ {
int total = 0; int total = 0;
for (const auto&& iter : *this) for (const auto&& iter : *this)
if (ESM::RefId::ciEqual(iter.getCellRef().getRefId(), id)) if (iter.getCellRef().getRefId() == id)
total += iter.getRefData().getCount(); total += iter.getRefData().getCount();
return total; return total;
} }
@ -252,7 +252,7 @@ bool MWWorld::ContainerStore::stacks(const ConstPtr& ptr1, const ConstPtr& ptr2)
const MWWorld::Class& cls1 = ptr1.getClass(); const MWWorld::Class& cls1 = ptr1.getClass();
const MWWorld::Class& cls2 = ptr2.getClass(); const MWWorld::Class& cls2 = ptr2.getClass();
if (!ESM::RefId::ciEqual(ptr1.getCellRef().getRefId(), ptr2.getCellRef().getRefId())) if (!(ptr1.getCellRef().getRefId() == ptr2.getCellRef().getRefId()))
return false; return false;
// If it has an enchantment, don't stack when some of the charge is already used // If it has an enchantment, don't stack when some of the charge is already used
@ -372,7 +372,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp(const Ptr& ptr,
for (MWWorld::ContainerStoreIterator iter(begin(type)); iter != end(); ++iter) for (MWWorld::ContainerStoreIterator iter(begin(type)); iter != end(); ++iter)
{ {
if (ESM::RefId::ciEqual(iter->getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId)) if (iter->getCellRef().getRefId() == MWWorld::ContainerStore::sGoldId)
{ {
iter->getRefData().setCount(addItems(iter->getRefData().getCount(false), realCount)); iter->getRefData().setCount(addItems(iter->getRefData().getCount(false), realCount));
flagAsModified(); flagAsModified();
@ -512,7 +512,7 @@ int MWWorld::ContainerStore::remove(
int toRemove = count; int toRemove = count;
for (ContainerStoreIterator iter(begin()); iter != end() && toRemove > 0; ++iter) for (ContainerStoreIterator iter(begin()); iter != end() && toRemove > 0; ++iter)
if (ESM::RefId::ciEqual(iter->getCellRef().getRefId(), itemId)) if (iter->getCellRef().getRefId() == itemId)
toRemove -= remove(*iter, toRemove, actor, equipReplacement, resolveFirst); toRemove -= remove(*iter, toRemove, actor, equipReplacement, resolveFirst);
flagAsModified(); flagAsModified();
@ -789,7 +789,7 @@ MWWorld::Ptr MWWorld::ContainerStore::findReplacement(const ESM::RefId& id)
for (auto&& iter : *this) for (auto&& iter : *this)
{ {
int iterHealth = iter.getClass().hasItemHealth(iter) ? iter.getClass().getItemHealth(iter) : 1; int iterHealth = iter.getClass().hasItemHealth(iter) ? iter.getClass().getItemHealth(iter) : 1;
if (ESM::RefId::ciEqual(iter.getCellRef().getRefId(), id)) if (iter.getCellRef().getRefId() == id)
{ {
// Prefer the stack with the lowest remaining uses // Prefer the stack with the lowest remaining uses
// Try to get item with zero durability only if there are no other items found // Try to get item with zero durability only if there are no other items found

View file

@ -106,7 +106,7 @@ namespace
{ {
Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '" Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '"
<< npc.mFaction << "', ignoring it."; << npc.mFaction << "', ignoring it.";
npc.mFaction.clear(); npc.mFaction = ESM::RefId::sEmpty;
npc.mNpdt.mRank = 0; npc.mNpdt.mRank = 0;
changed = true; changed = true;
} }
@ -138,7 +138,7 @@ namespace
{ {
if (!item.mScript.empty() && !scripts.search(item.mScript)) if (!item.mScript.empty() && !scripts.search(item.mScript))
{ {
item.mScript.clear(); item.mScript = ESM::RefId::sEmpty;
Log(Debug::Verbose) << "Item '" << id << "' (" << item.mName << ") has nonexistent script '" Log(Debug::Verbose) << "Item '" << id << "' (" << item.mName << ") has nonexistent script '"
<< item.mScript << "', ignoring it."; << item.mScript << "', ignoring it.";
} }
@ -687,7 +687,7 @@ namespace MWWorld
{ {
auto& npcs = getWritable<ESM::NPC>(); auto& npcs = getWritable<ESM::NPC>();
if (ESM::RefId::ciEqual(npc.mId, ESM::RefId::stringRefId("player"))) if (npc.mId == ESM::RefId::stringRefId("player"))
{ {
return npcs.insert(npc); return npcs.insert(npc);
} }

View file

@ -313,7 +313,7 @@ namespace MWWorld
void Player::clear() void Player::clear()
{ {
mCellStore = nullptr; mCellStore = nullptr;
mSign.clear(); mSign = ESM::RefId::sEmpty;
mMarkedCell = nullptr; mMarkedCell = nullptr;
mAutoMove = false; mAutoMove = false;
mForwardBackward = 0; mForwardBackward = 0;

View file

@ -544,7 +544,7 @@ namespace MWWorld
MWWorld::InventoryStore& inv = caster.getClass().getInventoryStore(caster); MWWorld::InventoryStore& inv = caster.getClass().getInventoryStore(caster);
MWWorld::ContainerStoreIterator invIt = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); MWWorld::ContainerStoreIterator invIt = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
if (invIt != inv.end() if (invIt != inv.end()
&& ESM::RefId::ciEqual(invIt->getCellRef().getRefId(), projectileState.mBowId)) && invIt->getCellRef().getRefId() == projectileState.mBowId)
bow = *invIt; bow = *invIt;
} }
if (projectile->getHitWater()) if (projectile->getHitWater())

View file

@ -254,7 +254,7 @@ namespace MWWorld
while (sharedIter != mShared.end() && sharedIter != end) while (sharedIter != mShared.end() && sharedIter != end)
{ {
if (ESM::RefId::ciEqual((*sharedIter)->mId, id)) if ((*sharedIter)->mId == id)
{ {
mShared.erase(sharedIter); mShared.erase(sharedIter);
break; break;
@ -359,7 +359,7 @@ namespace MWWorld
ESM::LandTexture* tex = const_cast<ESM::LandTexture*>(search(lt.mIndex, i)); ESM::LandTexture* tex = const_cast<ESM::LandTexture*>(search(lt.mIndex, i));
if (tex) if (tex)
{ {
if (ESM::RefId::ciEqual(tex->mId, lt.mId)) if (tex->mId == lt.mId)
tex->mTexture = lt.mTexture; tex->mTexture = lt.mTexture;
} }
} }
@ -716,7 +716,7 @@ namespace MWWorld
const ESM::Cell* cell = nullptr; const ESM::Cell* cell = nullptr;
for (const ESM::Cell* sharedCell : mSharedExt) for (const ESM::Cell* sharedCell : mSharedExt)
{ {
if (ESM::RefId::ciEqual(ESM::RefId::stringRefId(sharedCell->mName), id)) if (ESM::RefId::stringRefId(sharedCell->mName) == id)
{ {
if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX) if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX)
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY)) || (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))
@ -732,7 +732,7 @@ namespace MWWorld
const ESM::Cell* cell = nullptr; const ESM::Cell* cell = nullptr;
for (const ESM::Cell* sharedCell : mSharedExt) for (const ESM::Cell* sharedCell : mSharedExt)
{ {
if (ESM::RefId::ciEqual(sharedCell->mRegion, id)) if (sharedCell->mRegion == id)
{ {
if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX) if (cell == nullptr || (sharedCell->mData.mX > cell->mData.mX)
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY)) || (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))

View file

@ -203,8 +203,8 @@ namespace MWWorld
else else
mAmbientLoopSoundID = ESM::RefId::stringRefId(Fallback::Map::getString("Weather_" + name + "_Ambient_Loop_Sound_ID")); mAmbientLoopSoundID = ESM::RefId::stringRefId(Fallback::Map::getString("Weather_" + name + "_Ambient_Loop_Sound_ID"));
if (ESM::RefId::ciEqual(mAmbientLoopSoundID, ESM::RefId::stringRefId("None"))) if (mAmbientLoopSoundID == ESM::RefId::stringRefId("None"))
mAmbientLoopSoundID.clear(); mAmbientLoopSoundID = ESM::RefId::sEmpty;
} }
float Weather::transitionDelta() const float Weather::transitionDelta() const
@ -827,7 +827,7 @@ namespace MWWorld
if (mAmbientSound) if (mAmbientSound)
MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound); MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound);
mAmbientSound = nullptr; mAmbientSound = nullptr;
mPlayingSoundID.clear(); mPlayingSoundID = ESM::RefId::sEmpty;
} }
float WeatherManager::getWindSpeed() const float WeatherManager::getWindSpeed() const
@ -959,7 +959,7 @@ namespace MWWorld
{ {
stopSounds(); stopSounds();
mCurrentRegion.clear(); mCurrentRegion = ESM::RefId::sEmpty;
mTimePassed = 0.0f; mTimePassed = 0.0f;
mWeatherUpdateTime = 0.0f; mWeatherUpdateTime = 0.0f;
forceWeather(0); forceWeather(0);
@ -991,7 +991,7 @@ namespace MWWorld
MWWorld::ConstPtr player = MWMechanics::getPlayer(); MWWorld::ConstPtr player = MWMechanics::getPlayer();
if (player.isInCell()) if (player.isInCell())
{ {
if (ESM::RefId::ciEqual(regionID, mCurrentRegion)) if (regionID == mCurrentRegion)
{ {
addWeatherTransition(region.getWeather()); addWeatherTransition(region.getWeather());
} }

View file

@ -1759,13 +1759,13 @@ namespace MWWorld
{ {
bool update = false; bool update = false;
if (ESM::RefId::ciEqual(record.mId, ESM::RefId::stringRefId("player"))) if (record.mId == ESM::RefId::stringRefId("player"))
{ {
const ESM::NPC* player = mPlayer->getPlayer().get<ESM::NPC>()->mBase; const ESM::NPC* player = mPlayer->getPlayer().get<ESM::NPC>()->mBase;
update = record.isMale() != player->isMale() || !ESM::RefId::ciEqual(record.mRace, player->mRace) update = record.isMale() != player->isMale() || !(record.mRace == player->mRace)
|| !ESM::RefId::ciEqual(record.mHead, player->mHead) || !(record.mHead == player->mHead)
|| !ESM::RefId::ciEqual(record.mHair, player->mHair); || !(record.mHair == player->mHair);
} }
const ESM::NPC* ret = mStore.insert(record); const ESM::NPC* ret = mStore.insert(record);
if (update) if (update)
@ -2719,7 +2719,7 @@ namespace MWWorld
if (ptr.getClass().getCapacity(ptr) <= 0.f) if (ptr.getClass().getCapacity(ptr) <= 0.f)
return true; return true;
if (ESM::RefId::ciEqual(ptr.getCellRef().getOwner(), mOwner.getCellRef().getRefId())) if (ptr.getCellRef().getOwner() == mOwner.getCellRef().getRefId())
mOut.push_back(ptr); mOut.push_back(ptr);
return true; return true;
@ -2741,7 +2741,7 @@ namespace MWWorld
{ {
cellstore->forEach([&](const auto& ptr) { cellstore->forEach([&](const auto& ptr) {
if (ptr.getRefData().getBaseNode() if (ptr.getRefData().getBaseNode()
&& ESM::RefId::ciEqual(ptr.getCellRef().getOwner(), npc.getCellRef().getRefId())) && ptr.getCellRef().getOwner() == npc.getCellRef().getRefId())
out.push_back(ptr); out.push_back(ptr);
return true; return true;
}); });

View file

@ -4,9 +4,9 @@
#include "components/misc/strings/algorithm.hpp" #include "components/misc/strings/algorithm.hpp"
bool ESM::RefId::ciEqual(const RefId & left, const RefId & right) bool ESM::RefId::operator==(const RefId& rhs) const
{ {
return Misc::StringUtils::ciEqual(left.mId, right.mId); return Misc::StringUtils::ciEqual(this->mId, rhs.mId);
} }
namespace ESM namespace ESM

View file

@ -9,13 +9,11 @@ namespace ESM
struct RefId struct RefId
{ {
const static RefId sEmpty; const static RefId sEmpty;
void clear() { mId.clear(); }
bool empty() const { return mId.empty(); } bool empty() const { return mId.empty(); }
void swap(RefId& rhs) { mId.swap(rhs.mId); } void swap(RefId& rhs) { mId.swap(rhs.mId); }
bool operator==(const RefId& rhs) const { return ciEqual(*this, rhs); } bool operator==(const RefId& rhs) const;
bool operator<(const RefId& rhs) const { return mId < rhs.mId; } bool operator<(const RefId& rhs) const { return mId < rhs.mId; }
bool operator>(const RefId& rhs) const { return mId > rhs.mId; } bool operator>(const RefId& rhs) const { return mId > rhs.mId; }
static bool ciEqual(const RefId& left, const RefId& right);
friend std::ostream& operator<<(std::ostream& os, const RefId& dt); friend std::ostream& operator<<(std::ostream& os, const RefId& dt);
@ -38,11 +36,7 @@ namespace std
{ {
std::size_t operator()(const ESM::RefId& k) const std::size_t operator()(const ESM::RefId& k) const
{ {
using std::hash; return std::hash<std::string>()(k.getRefIdString());
using std::size_t;
using std::string;
return hash<string>()(k.getRefIdString());
} }
}; };
} }

View file

@ -149,7 +149,7 @@ namespace ESM
if (cellRef.mLockLevel == 0 && !cellRef.mKey.empty()) if (cellRef.mLockLevel == 0 && !cellRef.mKey.empty())
{ {
cellRef.mLockLevel = UnbreakableLock; cellRef.mLockLevel = UnbreakableLock;
cellRef.mTrap.clear(); cellRef.mTrap = ESM::RefId::sEmpty;
} }
} }
} }
@ -260,12 +260,12 @@ namespace ESM
void CellRef::blank() void CellRef::blank()
{ {
mRefNum.unset(); mRefNum.unset();
mRefID.clear(); mRefID = ESM::RefId::sEmpty;
mScale = 1; mScale = 1;
mOwner.clear(); mOwner = ESM::RefId::sEmpty;
mGlobalVariable.clear(); mGlobalVariable.clear();
mSoul.clear(); mSoul = ESM::RefId::sEmpty;
mFaction.clear(); mFaction = ESM::RefId::sEmpty;
mFactionRank = -2; mFactionRank = -2;
mChargeInt = -1; mChargeInt = -1;
mChargeIntRemainder = 0.0f; mChargeIntRemainder = 0.0f;
@ -273,8 +273,8 @@ namespace ESM
mGoldValue = 1; mGoldValue = 1;
mDestCell.clear(); mDestCell.clear();
mLockLevel = 0; mLockLevel = 0;
mKey.clear(); mKey = ESM::RefId::sEmpty;
mTrap.clear(); mTrap = ESM::RefId::sEmpty;
mReferenceBlocked = -1; mReferenceBlocked = -1;
mTeleport = false; mTeleport = false;

View file

@ -120,7 +120,7 @@ namespace ESM
const int count = entry.second; const int count = entry.second;
for (auto& item : mItems) for (auto& item : mItems)
{ {
if (item.mCount == count && ESM::RefId::ciEqual(id, item.mRef.mRefID)) if (item.mCount == count && id == item.mRef.mRefID)
item.mCount = -count; item.mCount = -count;
} }
} }

View file

@ -61,7 +61,7 @@ namespace ESM
{ {
mRecordFlags = 0; mRecordFlags = 0;
mName.clear(); mName.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mModel.clear(); mModel.clear();
} }
} }

View file

@ -84,7 +84,7 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mEffects.mList.clear(); mEffects.mList.clear();
} }
} }

View file

@ -79,7 +79,7 @@ namespace ESM
mData.mValue = 0; mData.mValue = 0;
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mName.clear(); mName.clear();
} }
} }

View file

@ -122,7 +122,7 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mEnchant.clear(); mEnchant = ESM::RefId::sEmpty;
} }
} }

View file

@ -71,6 +71,6 @@ namespace ESM
mData.mType = 0; mData.mType = 0;
mModel.clear(); mModel.clear();
mRace.clear(); mRace = ESM::RefId::sEmpty;
} }
} }

View file

@ -88,8 +88,8 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mEnchant.clear(); mEnchant = ESM::RefId::sEmpty;
mText.clear(); mText.clear();
} }
} }

View file

@ -315,7 +315,7 @@ namespace ESM
void Cell::blank() void Cell::blank()
{ {
mName.clear(); mName.clear();
mRegion.clear(); mRegion = ESM::RefId::sEmpty;
mWater = 0; mWater = 0;
mWaterInt = false; mWaterInt = false;
mMapColor = 0; mMapColor = 0;

View file

@ -94,7 +94,7 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mEnchant.clear(); mEnchant = ESM::RefId::sEmpty;
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -113,7 +113,7 @@ namespace ESM
mRecordFlags = 0; mRecordFlags = 0;
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mWeight = 0; mWeight = 0;
mFlags = 0x8; // set default flag value mFlags = 0x8; // set default flag value
mInventory.mList.clear(); mInventory.mList.clear();

View file

@ -152,8 +152,8 @@ namespace ESM
mScale = 1.f; mScale = 1.f;
mModel.clear(); mModel.clear();
mName.clear(); mName.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mOriginal.clear(); mOriginal = ESM::RefId::sEmpty;
mInventory.mList.clear(); mInventory.mList.clear();
mSpells.mList.clear(); mSpells.mList.clear();
mAiData.blank(); mAiData.blank();

View file

@ -71,8 +71,8 @@ namespace ESM
mRecordFlags = 0; mRecordFlags = 0;
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
mOpenSound.clear(); mOpenSound = ESM::RefId::sEmpty;
mCloseSound.clear(); mCloseSound = ESM::RefId::sEmpty;
} }
} }

View file

@ -140,15 +140,15 @@ namespace ESM
mData = {}; mData = {};
mSelects.clear(); mSelects.clear();
mPrev.clear(); mPrev = ESM::RefId::sEmpty;
mNext.clear(); mNext = ESM::RefId::sEmpty;
mActor.clear(); mActor = ESM::RefId::sEmpty;
mRace.clear(); mRace = ESM::RefId::sEmpty;
mClass.clear(); mClass = ESM::RefId::sEmpty;
mFaction.clear(); mFaction = ESM::RefId::sEmpty;
mPcFaction.clear(); mPcFaction = ESM::RefId::sEmpty;
mCell.clear(); mCell = ESM::RefId::sEmpty;
mSound.clear(); mSound = ESM::RefId::sEmpty;
mResponse.clear(); mResponse.clear();
mResultScript.clear(); mResultScript.clear();
mFactionLess = false; mFactionLess = false;

View file

@ -102,6 +102,6 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -82,8 +82,8 @@ namespace ESM
mData.mRadius = 0; mData.mRadius = 0;
mData.mColor = 0; mData.mColor = 0;
mData.mFlags = 0; mData.mFlags = 0;
mSound.clear(); mSound = ESM::RefId::sEmpty;
mScript.clear(); mScript = ESM::RefId::sEmpty;
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mName.clear(); mName.clear();

View file

@ -81,6 +81,6 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -57,7 +57,7 @@ namespace ESM
void LandTexture::blank() void LandTexture::blank()
{ {
mId.clear(); mId = ESM::RefId::sEmpty;
mTexture.clear(); mTexture.clear();
} }
} }

View file

@ -581,14 +581,14 @@ namespace ESM
mIcon.clear(); mIcon.clear();
mParticle.clear(); mParticle.clear();
mCasting.clear(); mCasting = ESM::RefId::sEmpty;
mHit.clear(); mHit = ESM::RefId::sEmpty;
mArea.clear(); mArea = ESM::RefId::sEmpty;
mBolt.clear(); mBolt = ESM::RefId::sEmpty;
mCastSound.clear(); mCastSound = ESM::RefId::sEmpty;
mBoltSound.clear(); mBoltSound = ESM::RefId::sEmpty;
mHitSound.clear(); mHitSound = ESM::RefId::sEmpty;
mAreaSound.clear(); mAreaSound = ESM::RefId::sEmpty;
mDescription.clear(); mDescription.clear();
} }

View file

@ -79,6 +79,6 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -202,12 +202,12 @@ namespace ESM
mAiPackage.mList.clear(); mAiPackage.mList.clear();
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mRace.clear(); mRace = ESM::RefId::sEmpty;
mClass.clear(); mClass = ESM::RefId::sEmpty;
mFaction.clear(); mFaction = ESM::RefId::sEmpty;
mScript.clear(); mScript = ESM::RefId::sEmpty;
mHair.clear(); mHair = ESM::RefId::sEmpty;
mHead.clear(); mHead = ESM::RefId::sEmpty;
} }
void NPC::blankNpdt() void NPC::blankNpdt()

View file

@ -186,7 +186,7 @@ namespace ESM
void Pathgrid::blank() void Pathgrid::blank()
{ {
mCell.clear(); mCell = ESM::RefId::sEmpty;
mData.mX = 0; mData.mX = 0;
mData.mY = 0; mData.mY = 0;
mData.mS1 = 0; mData.mS1 = 0;

View file

@ -81,6 +81,6 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -110,7 +110,7 @@ namespace ESM
mMapColor = 0; mMapColor = 0;
mName.clear(); mName.clear();
mSleepList.clear(); mSleepList = ESM::RefId::sEmpty;
mSoundList.clear(); mSoundList.clear();
} }
} }

View file

@ -81,6 +81,6 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -66,7 +66,7 @@ namespace ESM
{ {
mRecordFlags = 0; mRecordFlags = 0;
mType = LeftFoot; mType = LeftFoot;
mCreature.clear(); mCreature = ESM::RefId::sEmpty;
mSound.clear(); mSound = ESM::RefId::sEmpty;
} }
} }

View file

@ -91,7 +91,7 @@ namespace ESM
mName.clear(); mName.clear();
mModel.clear(); mModel.clear();
mIcon.clear(); mIcon.clear();
mEnchant.clear(); mEnchant = ESM::RefId::sEmpty;
mScript.clear(); mScript = ESM::RefId::sEmpty;
} }
} }

View file

@ -24,7 +24,7 @@ namespace ESM
bool SpellList::exists(const ESM::RefId& spell) const bool SpellList::exists(const ESM::RefId& spell) const
{ {
for (auto it = mList.begin(); it != mList.end(); ++it) for (auto it = mList.begin(); it != mList.end(); ++it)
if (ESM::RefId::ciEqual(*it, spell)) if (*it == spell)
return true; return true;
return false; return false;
} }