mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-24 04:43:49 +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:
parent
ee941f9b09
commit
c8bb733360
@ -169,7 +169,7 @@ namespace MWClass
|
||||
++sound)
|
||||
{
|
||||
if (type == sound->mType && !sound->mCreature.empty()
|
||||
&& (ESM::RefId::ciEqual(*creatureId, sound->mCreature)))
|
||||
&& (*creatureId == sound->mCreature))
|
||||
sounds.push_back(&*sound);
|
||||
if (type == sound->mType && sound->mCreature.empty())
|
||||
fallbacksounds.push_back(&*sound);
|
||||
|
@ -284,7 +284,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>();
|
||||
|
||||
ESM::Armor newItem = *ref->mBase;
|
||||
newItem.mId.clear();
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
newItem.mEnchant = enchId;
|
||||
|
@ -146,7 +146,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Book>* ref = ptr.get<ESM::Book>();
|
||||
|
||||
ESM::Book newItem = *ref->mBase;
|
||||
newItem.mId.clear();
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mIsScroll = 1;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
|
@ -192,7 +192,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Clothing>* ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
ESM::Clothing newItem = *ref->mBase;
|
||||
newItem.mId.clear();
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
newItem.mEnchant = enchId;
|
||||
|
@ -266,7 +266,7 @@ namespace MWClass
|
||||
{
|
||||
text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -649,7 +649,7 @@ namespace MWClass
|
||||
while (sound != store.get<ESM::SoundGenerator>().end())
|
||||
{
|
||||
if (type == sound->mType && !sound->mCreature.empty()
|
||||
&& ESM::RefId::ciEqual(ourId, sound->mCreature))
|
||||
&& ourId == sound->mCreature)
|
||||
sounds.push_back(&*sound);
|
||||
if (type == sound->mType && sound->mCreature.empty())
|
||||
fallbacksounds.push_back(&*sound);
|
||||
@ -673,7 +673,7 @@ namespace MWClass
|
||||
while (sound != store.get<ESM::SoundGenerator>().end())
|
||||
{
|
||||
if (type == sound->mType && !sound->mCreature.empty()
|
||||
&& ESM::RefId::ciEqual(fallbackId, sound->mCreature))
|
||||
&& fallbackId == sound->mCreature)
|
||||
sounds.push_back(&*sound);
|
||||
++sound;
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ namespace MWClass
|
||||
|
||||
bool Miscellaneous::isGold(const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_001"))
|
||||
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_005"))
|
||||
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_010"))
|
||||
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_025"))
|
||||
|| ESM::RefId::ciEqual(ptr.getCellRef().getRefId(), ESM::RefId::stringRefId("gold_100"));
|
||||
return ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_001")
|
||||
|| ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_005")
|
||||
|| ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_010")
|
||||
|| ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_025")
|
||||
|| ptr.getCellRef().getRefId() == ESM::RefId::stringRefId("gold_100");
|
||||
}
|
||||
|
||||
void Miscellaneous::insertObjectRendering(
|
||||
@ -97,7 +97,7 @@ namespace MWClass
|
||||
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
||||
|
||||
// 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;
|
||||
else
|
||||
value = soulValue;
|
||||
|
@ -264,7 +264,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Weapon>* ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
ESM::Weapon newItem = *ref->mBase;
|
||||
newItem.mId.clear();
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
newItem.mEnchant = enchId;
|
||||
|
@ -138,7 +138,7 @@ namespace MWDialogue
|
||||
if (actor.getClass().getCreatureStats(actor).isDead())
|
||||
return false;
|
||||
|
||||
mLastTopic.clear();
|
||||
mLastTopic = ESM::RefId::sEmpty;
|
||||
// Note that we intentionally don't reset mPermanentDispositionChange
|
||||
|
||||
mChoice = -1;
|
||||
@ -375,7 +375,7 @@ namespace MWDialogue
|
||||
if (!inJournal(topicId, answer->mId))
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
else
|
||||
@ -744,7 +744,7 @@ namespace MWDialogue
|
||||
auto it = faction->mReactions.begin();
|
||||
for (; it != faction->mReactions.end(); ++it)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(it->first, faction2))
|
||||
if (it->first == faction2)
|
||||
return it->second;
|
||||
}
|
||||
return 0;
|
||||
|
@ -84,7 +84,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
|
||||
// actor id
|
||||
if (!info.mActor.empty())
|
||||
{
|
||||
if (!ESM::RefId::ciEqual(info.mActor, mActor.getCellRef().getRefId()))
|
||||
if (!(info.mActor == mActor.getCellRef().getRefId()))
|
||||
return false;
|
||||
}
|
||||
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>();
|
||||
|
||||
if (!ESM::RefId::ciEqual(info.mRace, cellRef->mBase->mRace))
|
||||
if (!(info.mRace == cellRef->mBase->mRace))
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
|
||||
if (isCreature)
|
||||
return true;
|
||||
|
||||
if (!ESM::RefId::ciEqual(mActor.getClass().getPrimaryFaction(mActor), info.mFaction))
|
||||
if (!(mActor.getClass().getPrimaryFaction(mActor) == info.mFaction))
|
||||
return false;
|
||||
|
||||
// check rank
|
||||
@ -536,19 +536,19 @@ bool MWDialogue::Filter::getSelectStructBoolean(const SelectWrapper& select) con
|
||||
|
||||
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:
|
||||
|
||||
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:
|
||||
|
||||
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:
|
||||
|
||||
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:
|
||||
{
|
||||
@ -562,8 +562,7 @@ bool MWDialogue::Filter::getSelectStructBoolean(const SelectWrapper& select) con
|
||||
|
||||
case SelectWrapper::Function_SameRace:
|
||||
|
||||
return ESM::RefId::ciEqual(
|
||||
mActor.get<ESM::NPC>()->mBase->mRace, player.get<ESM::NPC>()->mBase->mRace);
|
||||
return mActor.get<ESM::NPC>()->mBase->mRace == player.get<ESM::NPC>()->mBase->mRace;
|
||||
|
||||
case SelectWrapper::Function_SameFaction:
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace MWGui
|
||||
size_t count = mBirthList->getItemCount();
|
||||
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);
|
||||
break;
|
||||
@ -134,7 +134,7 @@ namespace MWGui
|
||||
return;
|
||||
|
||||
const ESM::RefId birthId = ESM::RefId::stringRefId(*mBirthList->getItemDataAt<std::string>(_index));
|
||||
if (ESM::RefId::ciEqual(mCurrentBirthId, birthId))
|
||||
if (mCurrentBirthId == birthId)
|
||||
return;
|
||||
|
||||
mCurrentBirthId = birthId;
|
||||
@ -168,7 +168,7 @@ namespace MWGui
|
||||
mBirthList->setIndexSelected(index);
|
||||
mCurrentBirthId = birthsignPair.first;
|
||||
}
|
||||
else if (ESM::RefId::ciEqual(birthsignPair.first, mCurrentBirthId))
|
||||
else if (birthsignPair.first == mCurrentBirthId)
|
||||
{
|
||||
mBirthList->setIndexSelected(index);
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ namespace MWGui
|
||||
break;
|
||||
case GM_ClassGenerate:
|
||||
mGenerateClassStep = 0;
|
||||
mGenerateClass.clear();
|
||||
mGenerateClass = ESM::RefId::sEmpty;
|
||||
mGenerateClassSpecializations[0] = 0;
|
||||
mGenerateClassSpecializations[1] = 0;
|
||||
mGenerateClassSpecializations[2] = 0;
|
||||
|
@ -157,7 +157,7 @@ namespace MWGui
|
||||
size_t count = mClassList->getItemCount();
|
||||
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);
|
||||
break;
|
||||
@ -195,7 +195,7 @@ namespace MWGui
|
||||
return;
|
||||
|
||||
const ESM::RefId* classId = mClassList->getItemDataAt<ESM::RefId>(_index);
|
||||
if (ESM::RefId::ciEqual(mCurrentClassId, *classId))
|
||||
if (mCurrentClassId == *classId)
|
||||
return;
|
||||
|
||||
mCurrentClassId = *classId;
|
||||
@ -234,7 +234,7 @@ namespace MWGui
|
||||
mCurrentClassId = id;
|
||||
mClassList->setIndexSelected(index);
|
||||
}
|
||||
else if (ESM::RefId::ciEqual(id, mCurrentClassId))
|
||||
else if (id == mCurrentClassId)
|
||||
{
|
||||
mClassList->setIndexSelected(index);
|
||||
}
|
||||
|
@ -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
|
||||
// relative ordering
|
||||
if (ESM::RefId::ciEqual(lastId, item.getCellRef().getRefId()))
|
||||
if (lastId == item.getCellRef().getRefId())
|
||||
continue;
|
||||
|
||||
lastId = item.getCellRef().getRefId();
|
||||
|
@ -422,7 +422,7 @@ namespace
|
||||
intptr_t topicId = 0; /// \todo get rid of intptr ids
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ namespace MWGui
|
||||
else
|
||||
{
|
||||
key->type = Type_Unassigned;
|
||||
key->id.clear();
|
||||
key->id = ESM::RefId::sEmpty;
|
||||
key->name.clear();
|
||||
|
||||
MyGUI::TextBox* textBox = key->button->createWidgetReal<MyGUI::TextBox>(
|
||||
|
@ -165,13 +165,13 @@ namespace MWGui
|
||||
|
||||
for (unsigned int i = 0; i < mAvailableHeads.size(); ++i)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(mAvailableHeads[i], proto.mHead))
|
||||
if (mAvailableHeads[i] == proto.mHead)
|
||||
mFaceIndex = 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;
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ namespace MWGui
|
||||
size_t count = mRaceList->getItemCount();
|
||||
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);
|
||||
break;
|
||||
@ -293,7 +293,7 @@ namespace MWGui
|
||||
return;
|
||||
|
||||
ESM::RefId raceId = ESM::RefId::stringRefId(*mRaceList->getItemDataAt<std::string>(_index));
|
||||
if (ESM::RefId::ciEqual(mCurrentRaceId, raceId))
|
||||
if (mCurrentRaceId == raceId)
|
||||
return;
|
||||
|
||||
mCurrentRaceId = raceId;
|
||||
@ -334,7 +334,7 @@ namespace MWGui
|
||||
&& idString[idString.size() - 2] == 's' && idString[idString.size() - 1] == 't';
|
||||
if (firstPerson)
|
||||
continue;
|
||||
if (ESM::RefId::ciEqual(bodypart.mRace, mCurrentRaceId))
|
||||
if (bodypart.mRace == mCurrentRaceId)
|
||||
out.push_back(bodypart.mId);
|
||||
}
|
||||
}
|
||||
@ -393,7 +393,7 @@ namespace MWGui
|
||||
for (auto& item : items)
|
||||
{
|
||||
mRaceList->addItem(item.second, item.first);
|
||||
if (ESM::RefId::ciEqual(item.first, mCurrentRaceId))
|
||||
if (item.first == mCurrentRaceId)
|
||||
mRaceList->setIndexSelected(index);
|
||||
++index;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ namespace MWGui
|
||||
if (!mMerchant.isEmpty())
|
||||
{
|
||||
MWWorld::Ptr base = item.mBase;
|
||||
if (ESM::RefId::ciEqual(base.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
||||
if (base.getCellRef().getRefId() == MWWorld::ContainerStore::sGoldId)
|
||||
continue;
|
||||
|
||||
if (!base.getClass().showsInInventory(base))
|
||||
|
@ -1344,7 +1344,7 @@ namespace MWGui
|
||||
void WindowManager::setSelectedEnchantItem(const MWWorld::Ptr& item)
|
||||
{
|
||||
mSelectedEnchantItem = item;
|
||||
mSelectedSpell.clear();
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
const ESM::Enchantment* ench = mStore->get<ESM::Enchantment>().find(item.getClass().getEnchantment(item));
|
||||
|
||||
int chargePercent
|
||||
@ -1377,7 +1377,7 @@ namespace MWGui
|
||||
|
||||
void WindowManager::unsetSelectedSpell()
|
||||
{
|
||||
mSelectedSpell.clear();
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mSelectedEnchantItem = MWWorld::Ptr();
|
||||
mHud->unsetSelectedSpell();
|
||||
|
||||
@ -1770,7 +1770,7 @@ namespace MWGui
|
||||
|
||||
mToolTips->clear();
|
||||
|
||||
mSelectedSpell.clear();
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mCustomMarkers.clear();
|
||||
|
||||
mForceHidden = GW_None;
|
||||
|
@ -419,7 +419,7 @@ namespace MWMechanics
|
||||
bool ActiveSpells::isSpellActive(const ESM::RefId& id) const
|
||||
{
|
||||
return std::find_if(mSpells.begin(), mSpells.end(), [&](const auto& spell) {
|
||||
return ESM::RefId::ciEqual(spell.mId, id);
|
||||
return spell.mId == id;
|
||||
}) != mSpells.end();
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ int MWMechanics::Alchemy::addIngredient(const MWWorld::Ptr& ingredient)
|
||||
|
||||
for (TIngredientsIterator iter(mIngredients.begin()); iter != mIngredients.end(); ++iter)
|
||||
if (!iter->isEmpty()
|
||||
&& ESM::RefId::ciEqual(ingredient.getCellRef().getRefId(), iter->getCellRef().getRefId()))
|
||||
&& ingredient.getCellRef().getRefId() == iter->getCellRef().getRefId())
|
||||
return -1;
|
||||
|
||||
mIngredients[slot] = ingredient;
|
||||
|
@ -56,7 +56,7 @@ namespace MWMechanics
|
||||
caps.mLimit = iAutoSpellSchoolMax[i];
|
||||
caps.mReachedLimit = iAutoSpellSchoolMax[i] <= 0;
|
||||
caps.mMinCost = std::numeric_limits<int>::max();
|
||||
caps.mWeakestSpell.clear();
|
||||
caps.mWeakestSpell = ESM::RefId::sEmpty;
|
||||
schoolCaps[i] = caps;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ namespace MWMechanics
|
||||
|
||||
void CreatureStats::clearLastHitObject()
|
||||
{
|
||||
mLastHitObject.clear();
|
||||
mLastHitObject = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
const ESM::RefId& CreatureStats::getLastHitObject() const
|
||||
@ -386,7 +386,7 @@ namespace MWMechanics
|
||||
|
||||
void CreatureStats::clearLastHitAttemptObject()
|
||||
{
|
||||
mLastHitAttemptObject.clear();
|
||||
mLastHitAttemptObject = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
const ESM::RefId& CreatureStats::getLastHitAttemptObject() const
|
||||
|
@ -74,7 +74,7 @@ namespace MWMechanics
|
||||
|
||||
// Exception for Azura Star, new one will be added after enchanting
|
||||
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);
|
||||
|
||||
if (mSelfEnchanting)
|
||||
|
@ -20,7 +20,7 @@ namespace MWMechanics
|
||||
T copy = *MWBase::Environment::get().getWorld()->getStore().get<T>().find(actorId);
|
||||
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;
|
||||
it.mCount = sign * std::max(it.mCount * sign + amount, 0);
|
||||
|
@ -513,7 +513,7 @@ namespace MWMechanics
|
||||
const MWWorld::Store<ESM::GameSetting>& gmst
|
||||
= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
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;
|
||||
|
||||
static const float fDispPersonalityMult = gmst.find("fDispPersonalityMult")->mValue.getFloat();
|
||||
@ -913,7 +913,7 @@ namespace MWMechanics
|
||||
return false;
|
||||
|
||||
// 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)
|
||||
@ -1013,7 +1013,7 @@ namespace MWMechanics
|
||||
|
||||
const ESM::RefId& victimFaction = victim.getClass().getPrimaryFaction(victim);
|
||||
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.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()
|
||||
|| (victim.getClass().isActor() && victim.getRefData().getCount() > 0
|
||||
|
@ -99,7 +99,7 @@ namespace MWMechanics
|
||||
|
||||
ESM::RefId soulGemAzura = ESM::RefId::stringRefId("Misc_SoulGem_Azura");
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace MWMechanics
|
||||
// try to find a new tool of the same ID
|
||||
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;
|
||||
|
||||
|
@ -207,7 +207,7 @@ namespace
|
||||
{
|
||||
MWWorld::InventoryStore& store = actor.getClass().getInventoryStore(actor);
|
||||
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())
|
||||
return;
|
||||
int slot = getBoundItemSlot(*item);
|
||||
@ -215,7 +215,7 @@ namespace
|
||||
auto currentItem = store.getSlot(slot);
|
||||
|
||||
bool wasEquipped
|
||||
= currentItem != store.end() && ESM::RefId::ciEqual(currentItem->getCellRef().getRefId(), itemId);
|
||||
= currentItem != store.end() && currentItem->getCellRef().getRefId() == itemId;
|
||||
|
||||
if (wasEquipped)
|
||||
store.remove(*currentItem, 1, actor);
|
||||
|
@ -77,7 +77,7 @@ namespace MWMechanics
|
||||
bool changed = withBaseRecord([&](auto& spells) {
|
||||
for (const auto& it : spells)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(id, it))
|
||||
if (id == it)
|
||||
return false;
|
||||
}
|
||||
spells.push_back(id);
|
||||
@ -96,7 +96,7 @@ namespace MWMechanics
|
||||
bool changed = withBaseRecord([&](auto& spells) {
|
||||
for (auto it = spells.begin(); it != spells.end(); it++)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(id, *it))
|
||||
if (id == *it)
|
||||
{
|
||||
spells.erase(it);
|
||||
return true;
|
||||
@ -115,7 +115,7 @@ namespace MWMechanics
|
||||
{
|
||||
bool changed = withBaseRecord([&](auto& spells) {
|
||||
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);
|
||||
});
|
||||
if (it == spells.end())
|
||||
|
@ -83,7 +83,7 @@ namespace
|
||||
int actorId = caster.getClass().getCreatureStats(caster).getActorId();
|
||||
const auto& active = target.getClass().getCreatureStats(target).getActiveSpells();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ namespace MWMechanics
|
||||
removeSpell(spell);
|
||||
mSpellList->remove(spell);
|
||||
|
||||
if (ESM::RefId::ciEqual(spellId, mSelectedSpell))
|
||||
mSelectedSpell.clear();
|
||||
if (spellId == mSelectedSpell)
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
void Spells::removeSpell(const ESM::Spell* spell)
|
||||
|
@ -66,7 +66,7 @@ namespace
|
||||
continue;
|
||||
if (female != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female))
|
||||
continue;
|
||||
if (!ESM::RefId::ciEqual(bodypart.mRace, race))
|
||||
if (!(bodypart.mRace == race))
|
||||
continue;
|
||||
sVampireMapping[thisCombination] = &bodypart;
|
||||
}
|
||||
@ -1209,7 +1209,7 @@ namespace MWRender
|
||||
if (bodypart.mData.mType != ESM::BodyPart::MT_Skin)
|
||||
continue;
|
||||
|
||||
if (!ESM::RefId::ciEqual(bodypart.mRace, race))
|
||||
if (!(bodypart.mRace == race))
|
||||
continue;
|
||||
|
||||
bool partFirstPerson = isFirstPersonPart(&bodypart);
|
||||
|
@ -104,9 +104,9 @@ namespace MWScript
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(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_001");
|
||||
if (item == ESM::RefId::stringRefId("gold_005") ||item == ESM::RefId::stringRefId("gold_010")
|
||||
|| item == ESM::RefId::stringRefId("gold_025") ||item == ESM::RefId::stringRefId("gold_100"))
|
||||
item = ESM::RefId::stringRefId("gold_001");
|
||||
|
||||
// Check if "item" can be placed in a container
|
||||
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));
|
||||
runtime.pop();
|
||||
|
||||
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_010"))
|
||||
|| ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_025")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_100")))
|
||||
if (item == ESM::RefId::stringRefId("gold_005") ||item == ESM::RefId::stringRefId("gold_010")
|
||||
|| item == ESM::RefId::stringRefId("gold_025") ||item == ESM::RefId::stringRefId("gold_100"))
|
||||
item = ESM::RefId::stringRefId("gold_001");
|
||||
|
||||
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
||||
@ -222,8 +222,8 @@ namespace MWScript
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
if (ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_005")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_010"))
|
||||
|| ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_025")) || ESM::RefId::ciEqual(item, ESM::RefId::stringRefId("gold_100")))
|
||||
if (item == ESM::RefId::stringRefId("gold_005") || item == ESM::RefId::stringRefId("gold_010")
|
||||
|| item == ESM::RefId::stringRefId("gold_025") || item == ESM::RefId::stringRefId("gold_100"))
|
||||
item = ESM::RefId::stringRefId("gold_001");
|
||||
|
||||
// Explicit calls to non-unique actors affect the base record
|
||||
@ -260,7 +260,7 @@ namespace MWScript
|
||||
std::string_view itemName;
|
||||
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);
|
||||
break;
|
||||
@ -309,7 +309,7 @@ namespace MWScript
|
||||
// With soul gems we prefer filled ones.
|
||||
for (auto it = invStore.begin(); it != invStore.end(); ++it)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(it->getCellRef().getRefId(), item))
|
||||
if (it->getCellRef().getRefId() == item)
|
||||
{
|
||||
found = it;
|
||||
const ESM::RefId& soul = it->getCellRef().getSoul();
|
||||
@ -425,7 +425,7 @@ namespace MWScript
|
||||
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++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);
|
||||
return;
|
||||
@ -452,7 +452,7 @@ namespace MWScript
|
||||
= invStore.cbegin(MWWorld::ContainerStore::Type_Miscellaneous);
|
||||
it != invStore.cend(); ++it)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(it->getCellRef().getSoul(), name))
|
||||
if (it->getCellRef().getSoul() == name)
|
||||
count += it->getRefData().getCount();
|
||||
}
|
||||
runtime.push(count);
|
||||
|
@ -99,7 +99,7 @@ namespace
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
if (ESM::RefId::ciEqual(itemId, it->mId))
|
||||
if (itemId == it->mId)
|
||||
it = list->mList.erase(it);
|
||||
else
|
||||
++it;
|
||||
@ -612,7 +612,7 @@ namespace MWScript
|
||||
MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr);
|
||||
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);
|
||||
return;
|
||||
@ -655,7 +655,7 @@ namespace MWScript
|
||||
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++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();
|
||||
}
|
||||
@ -664,7 +664,7 @@ namespace MWScript
|
||||
for (int slot = 0; slot < MWWorld::InventoryStore::Slots && amount > numNotEquipped; ++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());
|
||||
store.unequipItemQuantity(*it, ptr, numToRemove);
|
||||
@ -674,7 +674,7 @@ namespace MWScript
|
||||
|
||||
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))
|
||||
{
|
||||
int removed = store.remove(*iter, amount, ptr);
|
||||
@ -730,7 +730,7 @@ namespace MWScript
|
||||
|
||||
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);
|
||||
store.remove(*iter, 1, ptr);
|
||||
@ -953,7 +953,7 @@ namespace MWScript
|
||||
runtime.pop();
|
||||
|
||||
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
||||
bool hit = ESM::RefId::ciEqual(objectID, stats.getLastHitObject());
|
||||
bool hit = objectID == stats.getLastHitObject();
|
||||
runtime.push(hit);
|
||||
if (hit)
|
||||
stats.clearLastHitObject();
|
||||
@ -972,7 +972,7 @@ namespace MWScript
|
||||
runtime.pop();
|
||||
|
||||
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
||||
bool hit = ESM::RefId::ciEqual(objectID, stats.getLastHitAttemptObject());
|
||||
bool hit = objectID == stats.getLastHitAttemptObject();
|
||||
runtime.push(hit);
|
||||
if (hit)
|
||||
stats.clearLastHitAttemptObject();
|
||||
|
@ -255,7 +255,7 @@ namespace MWScript
|
||||
runtime.pop();
|
||||
|
||||
// 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);
|
||||
|
||||
@ -870,7 +870,7 @@ namespace MWScript
|
||||
|
||||
const ESM::RefId& npcRace = ptr.get<ESM::NPC>()->mBase->mRace;
|
||||
|
||||
runtime.push(ESM::RefId::ciEqual(race, npcRace));
|
||||
runtime.push(race == npcRace);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -169,7 +169,7 @@ namespace
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ namespace
|
||||
|
||||
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);
|
||||
ptr.setContainerStore(store);
|
||||
@ -187,7 +187,7 @@ int MWWorld::ContainerStore::count(const ESM::RefId& id) const
|
||||
{
|
||||
int total = 0;
|
||||
for (const auto&& iter : *this)
|
||||
if (ESM::RefId::ciEqual(iter.getCellRef().getRefId(), id))
|
||||
if (iter.getCellRef().getRefId() == id)
|
||||
total += iter.getRefData().getCount();
|
||||
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& cls2 = ptr2.getClass();
|
||||
|
||||
if (!ESM::RefId::ciEqual(ptr1.getCellRef().getRefId(), ptr2.getCellRef().getRefId()))
|
||||
if (!(ptr1.getCellRef().getRefId() == ptr2.getCellRef().getRefId()))
|
||||
return false;
|
||||
|
||||
// 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)
|
||||
{
|
||||
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));
|
||||
flagAsModified();
|
||||
@ -512,7 +512,7 @@ int MWWorld::ContainerStore::remove(
|
||||
int toRemove = count;
|
||||
|
||||
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);
|
||||
|
||||
flagAsModified();
|
||||
@ -789,7 +789,7 @@ MWWorld::Ptr MWWorld::ContainerStore::findReplacement(const ESM::RefId& id)
|
||||
for (auto&& iter : *this)
|
||||
{
|
||||
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
|
||||
// Try to get item with zero durability only if there are no other items found
|
||||
|
@ -106,7 +106,7 @@ namespace
|
||||
{
|
||||
Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '"
|
||||
<< npc.mFaction << "', ignoring it.";
|
||||
npc.mFaction.clear();
|
||||
npc.mFaction = ESM::RefId::sEmpty;
|
||||
npc.mNpdt.mRank = 0;
|
||||
changed = true;
|
||||
}
|
||||
@ -138,7 +138,7 @@ namespace
|
||||
{
|
||||
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 '"
|
||||
<< item.mScript << "', ignoring it.";
|
||||
}
|
||||
@ -687,7 +687,7 @@ namespace MWWorld
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ namespace MWWorld
|
||||
void Player::clear()
|
||||
{
|
||||
mCellStore = nullptr;
|
||||
mSign.clear();
|
||||
mSign = ESM::RefId::sEmpty;
|
||||
mMarkedCell = nullptr;
|
||||
mAutoMove = false;
|
||||
mForwardBackward = 0;
|
||||
|
@ -544,7 +544,7 @@ namespace MWWorld
|
||||
MWWorld::InventoryStore& inv = caster.getClass().getInventoryStore(caster);
|
||||
MWWorld::ContainerStoreIterator invIt = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||
if (invIt != inv.end()
|
||||
&& ESM::RefId::ciEqual(invIt->getCellRef().getRefId(), projectileState.mBowId))
|
||||
&& invIt->getCellRef().getRefId() == projectileState.mBowId)
|
||||
bow = *invIt;
|
||||
}
|
||||
if (projectile->getHitWater())
|
||||
|
@ -254,7 +254,7 @@ namespace MWWorld
|
||||
|
||||
while (sharedIter != mShared.end() && sharedIter != end)
|
||||
{
|
||||
if (ESM::RefId::ciEqual((*sharedIter)->mId, id))
|
||||
if ((*sharedIter)->mId == id)
|
||||
{
|
||||
mShared.erase(sharedIter);
|
||||
break;
|
||||
@ -359,7 +359,7 @@ namespace MWWorld
|
||||
ESM::LandTexture* tex = const_cast<ESM::LandTexture*>(search(lt.mIndex, i));
|
||||
if (tex)
|
||||
{
|
||||
if (ESM::RefId::ciEqual(tex->mId, lt.mId))
|
||||
if (tex->mId == lt.mId)
|
||||
tex->mTexture = lt.mTexture;
|
||||
}
|
||||
}
|
||||
@ -716,7 +716,7 @@ namespace MWWorld
|
||||
const ESM::Cell* cell = nullptr;
|
||||
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)
|
||||
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))
|
||||
@ -732,7 +732,7 @@ namespace MWWorld
|
||||
const ESM::Cell* cell = nullptr;
|
||||
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)
|
||||
|| (sharedCell->mData.mX == cell->mData.mX && sharedCell->mData.mY > cell->mData.mY))
|
||||
|
@ -203,8 +203,8 @@ namespace MWWorld
|
||||
else
|
||||
mAmbientLoopSoundID = ESM::RefId::stringRefId(Fallback::Map::getString("Weather_" + name + "_Ambient_Loop_Sound_ID"));
|
||||
|
||||
if (ESM::RefId::ciEqual(mAmbientLoopSoundID, ESM::RefId::stringRefId("None")))
|
||||
mAmbientLoopSoundID.clear();
|
||||
if (mAmbientLoopSoundID == ESM::RefId::stringRefId("None"))
|
||||
mAmbientLoopSoundID = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
float Weather::transitionDelta() const
|
||||
@ -827,7 +827,7 @@ namespace MWWorld
|
||||
if (mAmbientSound)
|
||||
MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound);
|
||||
mAmbientSound = nullptr;
|
||||
mPlayingSoundID.clear();
|
||||
mPlayingSoundID = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
float WeatherManager::getWindSpeed() const
|
||||
@ -959,7 +959,7 @@ namespace MWWorld
|
||||
{
|
||||
stopSounds();
|
||||
|
||||
mCurrentRegion.clear();
|
||||
mCurrentRegion = ESM::RefId::sEmpty;
|
||||
mTimePassed = 0.0f;
|
||||
mWeatherUpdateTime = 0.0f;
|
||||
forceWeather(0);
|
||||
@ -991,7 +991,7 @@ namespace MWWorld
|
||||
MWWorld::ConstPtr player = MWMechanics::getPlayer();
|
||||
if (player.isInCell())
|
||||
{
|
||||
if (ESM::RefId::ciEqual(regionID, mCurrentRegion))
|
||||
if (regionID == mCurrentRegion)
|
||||
{
|
||||
addWeatherTransition(region.getWeather());
|
||||
}
|
||||
|
@ -1759,13 +1759,13 @@ namespace MWWorld
|
||||
{
|
||||
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;
|
||||
|
||||
update = record.isMale() != player->isMale() || !ESM::RefId::ciEqual(record.mRace, player->mRace)
|
||||
|| !ESM::RefId::ciEqual(record.mHead, player->mHead)
|
||||
|| !ESM::RefId::ciEqual(record.mHair, player->mHair);
|
||||
update = record.isMale() != player->isMale() || !(record.mRace == player->mRace)
|
||||
|| !(record.mHead == player->mHead)
|
||||
|| !(record.mHair == player->mHair);
|
||||
}
|
||||
const ESM::NPC* ret = mStore.insert(record);
|
||||
if (update)
|
||||
@ -2719,7 +2719,7 @@ namespace MWWorld
|
||||
if (ptr.getClass().getCapacity(ptr) <= 0.f)
|
||||
return true;
|
||||
|
||||
if (ESM::RefId::ciEqual(ptr.getCellRef().getOwner(), mOwner.getCellRef().getRefId()))
|
||||
if (ptr.getCellRef().getOwner() == mOwner.getCellRef().getRefId())
|
||||
mOut.push_back(ptr);
|
||||
|
||||
return true;
|
||||
@ -2741,7 +2741,7 @@ namespace MWWorld
|
||||
{
|
||||
cellstore->forEach([&](const auto& ptr) {
|
||||
if (ptr.getRefData().getBaseNode()
|
||||
&& ESM::RefId::ciEqual(ptr.getCellRef().getOwner(), npc.getCellRef().getRefId()))
|
||||
&& ptr.getCellRef().getOwner() == npc.getCellRef().getRefId())
|
||||
out.push_back(ptr);
|
||||
return true;
|
||||
});
|
||||
|
@ -4,9 +4,9 @@
|
||||
|
||||
#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
|
||||
|
@ -9,13 +9,11 @@ namespace ESM
|
||||
struct RefId
|
||||
{
|
||||
const static RefId sEmpty;
|
||||
void clear() { mId.clear(); }
|
||||
bool empty() const { return mId.empty(); }
|
||||
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; }
|
||||
static bool ciEqual(const RefId& left, const RefId& right);
|
||||
|
||||
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
|
||||
{
|
||||
using std::hash;
|
||||
using std::size_t;
|
||||
using std::string;
|
||||
|
||||
return hash<string>()(k.getRefIdString());
|
||||
return std::hash<std::string>()(k.getRefIdString());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ namespace ESM
|
||||
if (cellRef.mLockLevel == 0 && !cellRef.mKey.empty())
|
||||
{
|
||||
cellRef.mLockLevel = UnbreakableLock;
|
||||
cellRef.mTrap.clear();
|
||||
cellRef.mTrap = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,12 +260,12 @@ namespace ESM
|
||||
void CellRef::blank()
|
||||
{
|
||||
mRefNum.unset();
|
||||
mRefID.clear();
|
||||
mRefID = ESM::RefId::sEmpty;
|
||||
mScale = 1;
|
||||
mOwner.clear();
|
||||
mOwner = ESM::RefId::sEmpty;
|
||||
mGlobalVariable.clear();
|
||||
mSoul.clear();
|
||||
mFaction.clear();
|
||||
mSoul = ESM::RefId::sEmpty;
|
||||
mFaction = ESM::RefId::sEmpty;
|
||||
mFactionRank = -2;
|
||||
mChargeInt = -1;
|
||||
mChargeIntRemainder = 0.0f;
|
||||
@ -273,8 +273,8 @@ namespace ESM
|
||||
mGoldValue = 1;
|
||||
mDestCell.clear();
|
||||
mLockLevel = 0;
|
||||
mKey.clear();
|
||||
mTrap.clear();
|
||||
mKey = ESM::RefId::sEmpty;
|
||||
mTrap = ESM::RefId::sEmpty;
|
||||
mReferenceBlocked = -1;
|
||||
mTeleport = false;
|
||||
|
||||
|
@ -120,7 +120,7 @@ namespace ESM
|
||||
const int count = entry.second;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ namespace ESM
|
||||
{
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mModel.clear();
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEffects.mList.clear();
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ namespace ESM
|
||||
mData.mValue = 0;
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mName.clear();
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mEnchant.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,6 @@ namespace ESM
|
||||
mData.mType = 0;
|
||||
|
||||
mModel.clear();
|
||||
mRace.clear();
|
||||
mRace = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -88,8 +88,8 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mEnchant.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mText.clear();
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ namespace ESM
|
||||
void Cell::blank()
|
||||
{
|
||||
mName.clear();
|
||||
mRegion.clear();
|
||||
mRegion = ESM::RefId::sEmpty;
|
||||
mWater = 0;
|
||||
mWaterInt = false;
|
||||
mMapColor = 0;
|
||||
|
@ -94,7 +94,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mEnchant.clear();
|
||||
mScript.clear();
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ namespace ESM
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mWeight = 0;
|
||||
mFlags = 0x8; // set default flag value
|
||||
mInventory.mList.clear();
|
||||
|
@ -152,8 +152,8 @@ namespace ESM
|
||||
mScale = 1.f;
|
||||
mModel.clear();
|
||||
mName.clear();
|
||||
mScript.clear();
|
||||
mOriginal.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mOriginal = ESM::RefId::sEmpty;
|
||||
mInventory.mList.clear();
|
||||
mSpells.mList.clear();
|
||||
mAiData.blank();
|
||||
|
@ -71,8 +71,8 @@ namespace ESM
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mScript.clear();
|
||||
mOpenSound.clear();
|
||||
mCloseSound.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mOpenSound = ESM::RefId::sEmpty;
|
||||
mCloseSound = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -140,15 +140,15 @@ namespace ESM
|
||||
mData = {};
|
||||
|
||||
mSelects.clear();
|
||||
mPrev.clear();
|
||||
mNext.clear();
|
||||
mActor.clear();
|
||||
mRace.clear();
|
||||
mClass.clear();
|
||||
mFaction.clear();
|
||||
mPcFaction.clear();
|
||||
mCell.clear();
|
||||
mSound.clear();
|
||||
mPrev = ESM::RefId::sEmpty;
|
||||
mNext = ESM::RefId::sEmpty;
|
||||
mActor = ESM::RefId::sEmpty;
|
||||
mRace = ESM::RefId::sEmpty;
|
||||
mClass = ESM::RefId::sEmpty;
|
||||
mFaction = ESM::RefId::sEmpty;
|
||||
mPcFaction = ESM::RefId::sEmpty;
|
||||
mCell = ESM::RefId::sEmpty;
|
||||
mSound = ESM::RefId::sEmpty;
|
||||
mResponse.clear();
|
||||
mResultScript.clear();
|
||||
mFactionLess = false;
|
||||
|
@ -102,6 +102,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ namespace ESM
|
||||
mData.mRadius = 0;
|
||||
mData.mColor = 0;
|
||||
mData.mFlags = 0;
|
||||
mSound.clear();
|
||||
mScript.clear();
|
||||
mSound = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mName.clear();
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace ESM
|
||||
|
||||
void LandTexture::blank()
|
||||
{
|
||||
mId.clear();
|
||||
mId = ESM::RefId::sEmpty;
|
||||
mTexture.clear();
|
||||
}
|
||||
}
|
||||
|
@ -581,14 +581,14 @@ namespace ESM
|
||||
|
||||
mIcon.clear();
|
||||
mParticle.clear();
|
||||
mCasting.clear();
|
||||
mHit.clear();
|
||||
mArea.clear();
|
||||
mBolt.clear();
|
||||
mCastSound.clear();
|
||||
mBoltSound.clear();
|
||||
mHitSound.clear();
|
||||
mAreaSound.clear();
|
||||
mCasting = ESM::RefId::sEmpty;
|
||||
mHit = ESM::RefId::sEmpty;
|
||||
mArea = ESM::RefId::sEmpty;
|
||||
mBolt = ESM::RefId::sEmpty;
|
||||
mCastSound = ESM::RefId::sEmpty;
|
||||
mBoltSound = ESM::RefId::sEmpty;
|
||||
mHitSound = ESM::RefId::sEmpty;
|
||||
mAreaSound = ESM::RefId::sEmpty;
|
||||
mDescription.clear();
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -202,12 +202,12 @@ namespace ESM
|
||||
mAiPackage.mList.clear();
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mRace.clear();
|
||||
mClass.clear();
|
||||
mFaction.clear();
|
||||
mScript.clear();
|
||||
mHair.clear();
|
||||
mHead.clear();
|
||||
mRace = ESM::RefId::sEmpty;
|
||||
mClass = ESM::RefId::sEmpty;
|
||||
mFaction = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mHair = ESM::RefId::sEmpty;
|
||||
mHead = ESM::RefId::sEmpty;
|
||||
}
|
||||
|
||||
void NPC::blankNpdt()
|
||||
|
@ -186,7 +186,7 @@ namespace ESM
|
||||
|
||||
void Pathgrid::blank()
|
||||
{
|
||||
mCell.clear();
|
||||
mCell = ESM::RefId::sEmpty;
|
||||
mData.mX = 0;
|
||||
mData.mY = 0;
|
||||
mData.mS1 = 0;
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace ESM
|
||||
mMapColor = 0;
|
||||
|
||||
mName.clear();
|
||||
mSleepList.clear();
|
||||
mSleepList = ESM::RefId::sEmpty;
|
||||
mSoundList.clear();
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace ESM
|
||||
{
|
||||
mRecordFlags = 0;
|
||||
mType = LeftFoot;
|
||||
mCreature.clear();
|
||||
mSound.clear();
|
||||
mCreature = ESM::RefId::sEmpty;
|
||||
mSound = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mEnchant.clear();
|
||||
mScript.clear();
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace ESM
|
||||
bool SpellList::exists(const ESM::RefId& spell) const
|
||||
{
|
||||
for (auto it = mList.begin(); it != mList.end(); ++it)
|
||||
if (ESM::RefId::ciEqual(*it, spell))
|
||||
if (*it == spell)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user