mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-15 22:49:48 +00:00
Replace ESM::RefId::sEmpty by default constructed RefId where possible
Static const is only required to provide a reference or a pointer when it is not possible with default constructed temporary.
This commit is contained in:
parent
9487312fb8
commit
b5ec584be2
@ -190,7 +190,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
||||
ESM::DialInfo info = record.get();
|
||||
info.mId = record.get().mOriginalId;
|
||||
|
||||
info.mPrev = ESM::RefId::sEmpty;
|
||||
info.mPrev = ESM::RefId();
|
||||
if (iter != infos.begin())
|
||||
{
|
||||
const auto prev = std::prev(iter);
|
||||
@ -199,7 +199,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
||||
|
||||
const auto next = std::next(iter);
|
||||
|
||||
info.mNext = ESM::RefId::sEmpty;
|
||||
info.mNext = ESM::RefId();
|
||||
if (next != infos.end())
|
||||
info.mNext = (*next)->get().mOriginalId;
|
||||
|
||||
|
@ -92,7 +92,7 @@ int CSMTools::ScriptCheckStage::setup()
|
||||
|
||||
mContext.clear();
|
||||
mMessages = nullptr;
|
||||
mId = ESM::RefId::sEmpty;
|
||||
mId = ESM::RefId();
|
||||
Compiler::ErrorHandler::reset();
|
||||
|
||||
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||
|
@ -94,9 +94,9 @@ namespace CSMWorld
|
||||
mId = id;
|
||||
mIsBeast = isBeast;
|
||||
for (auto& str : mFemaleParts)
|
||||
str = ESM::RefId::sEmpty;
|
||||
str = ESM::RefId();
|
||||
for (auto& str : mMaleParts)
|
||||
str = ESM::RefId::sEmpty;
|
||||
str = ESM::RefId();
|
||||
mDependencies.clear();
|
||||
|
||||
// Mark self as a dependency
|
||||
@ -591,7 +591,7 @@ namespace CSMWorld
|
||||
|
||||
// An another vanilla quirk: hide hairs if an item replaces Head part
|
||||
if (partType == ESM::PRT_Head)
|
||||
data->setPart(ESM::PRT_Hair, ESM::RefId::sEmpty, priority);
|
||||
data->setPart(ESM::PRT_Hair, ESM::RefId(), priority);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -255,7 +255,7 @@ namespace CSMWorld
|
||||
std::map<ESM::RefId, int>& reactions = faction.mReactions;
|
||||
|
||||
// blank row
|
||||
reactions.insert(std::make_pair(ESM::RefId::sEmpty, 0));
|
||||
reactions.insert(std::make_pair(ESM::RefId(), 0));
|
||||
|
||||
record.setModified(faction);
|
||||
}
|
||||
@ -382,7 +382,7 @@ namespace CSMWorld
|
||||
|
||||
// blank row
|
||||
ESM::Region::SoundRef soundRef;
|
||||
soundRef.mSound = ESM::RefId::sEmpty;
|
||||
soundRef.mSound = ESM::RefId();
|
||||
soundRef.mChance = 0;
|
||||
|
||||
soundList.insert(soundList.begin() + position, soundRef);
|
||||
|
@ -63,7 +63,7 @@ void CSMWorld::RefCollection::load(ESM::ESMReader& reader, int cellIndex, bool b
|
||||
{
|
||||
// Keep mOriginalCell empty when in modified (as an indicator that the
|
||||
// original cell will always be equal the current cell).
|
||||
ref.mOriginalCell = base ? cell2.mId : ESM::RefId::sEmpty;
|
||||
ref.mOriginalCell = base ? cell2.mId : ESM::RefId();
|
||||
|
||||
if (cell.get().isExterior())
|
||||
{
|
||||
@ -329,7 +329,7 @@ int CSMWorld::RefCollection::searchId(const ESM::RefId& id) const
|
||||
|
||||
void CSMWorld::RefCollection::appendRecord(std::unique_ptr<RecordBase> record, UniversalId::Type type)
|
||||
{
|
||||
int index = getAppendIndex(/*id*/ ESM::RefId::sEmpty, type); // for CellRef records id is ignored
|
||||
int index = getAppendIndex(/*id*/ ESM::RefId(), type); // for CellRef records id is ignored
|
||||
|
||||
mRefIndex.insert(std::make_pair(static_cast<Record<CellRef>*>(record.get())->get().mIdNum, index));
|
||||
|
||||
@ -338,7 +338,7 @@ void CSMWorld::RefCollection::appendRecord(std::unique_ptr<RecordBase> record, U
|
||||
|
||||
void CSMWorld::RefCollection::insertRecord(std::unique_ptr<RecordBase> record, int index, UniversalId::Type type)
|
||||
{
|
||||
int size = getAppendIndex(/*id*/ ESM::RefId::sEmpty, type); // for CellRef records id is ignored
|
||||
int size = getAppendIndex(/*id*/ ESM::RefId(), type); // for CellRef records id is ignored
|
||||
unsigned int idNum = static_cast<Record<CellRef>*>(record.get())->get().mIdNum;
|
||||
|
||||
Collection<CellRef, IdAccessor<CellRef>>::insertRecord(std::move(record), index, type); // add records only
|
||||
|
@ -1986,8 +1986,8 @@ namespace CSMWorld
|
||||
|
||||
ESM::PartReference newPart;
|
||||
newPart.mPart = 0; // 0 == head
|
||||
newPart.mMale = ESM::RefId::sEmpty;
|
||||
newPart.mFemale = ESM::RefId::sEmpty;
|
||||
newPart.mMale = ESM::RefId();
|
||||
newPart.mFemale = ESM::RefId();
|
||||
|
||||
if (position >= (int)list.size())
|
||||
list.push_back(newPart);
|
||||
@ -2343,7 +2343,7 @@ namespace CSMWorld
|
||||
std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList;
|
||||
|
||||
ESM::LevelledListBase::LevelItem newItem;
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mId = ESM::RefId();
|
||||
newItem.mLevel = 0;
|
||||
|
||||
if (position >= (int)list.size())
|
||||
|
@ -127,7 +127,7 @@ namespace MWBase
|
||||
* @return was the crime seen?
|
||||
*/
|
||||
virtual bool commitCrime(const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim, OffenseType type,
|
||||
const ESM::RefId& factionId = ESM::RefId::sEmpty, int arg = 0, bool victimAware = false)
|
||||
const ESM::RefId& factionId = ESM::RefId(), int arg = 0, bool victimAware = false)
|
||||
= 0;
|
||||
/// @return false if the attack was considered a "friendly hit" and forgiven
|
||||
virtual bool actorAttacked(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) = 0;
|
||||
|
@ -285,7 +285,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>();
|
||||
|
||||
ESM::Armor newItem = *ref->mBase;
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mId = ESM::RefId();
|
||||
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 = ESM::RefId::sEmpty;
|
||||
newItem.mId = ESM::RefId();
|
||||
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 = ESM::RefId::sEmpty;
|
||||
newItem.mId = ESM::RefId();
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
newItem.mEnchant = enchId;
|
||||
|
@ -42,7 +42,7 @@ namespace MWClass
|
||||
unsigned int seed = Misc::Rng::rollDice(std::numeric_limits<int>::max(), prng);
|
||||
// setting ownership not needed, since taking items from a container inherits the
|
||||
// container's owner automatically
|
||||
mStore.fillNonRandom(container.mInventory, ESM::RefId::sEmpty, seed);
|
||||
mStore.fillNonRandom(container.mInventory, ESM::RefId(), seed);
|
||||
}
|
||||
|
||||
ContainerCustomData::ContainerCustomData(const ESM::InventoryState& inventory)
|
||||
@ -178,7 +178,7 @@ namespace MWClass
|
||||
// using a key disarms the trap
|
||||
if (isTrapped)
|
||||
{
|
||||
ptr.getCellRef().setTrap(ESM::RefId::sEmpty);
|
||||
ptr.getCellRef().setTrap(ESM::RefId());
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(
|
||||
ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f);
|
||||
isTrapped = false;
|
||||
@ -257,7 +257,7 @@ namespace MWClass
|
||||
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(lockLevel);
|
||||
else if (lockLevel < 0)
|
||||
text += "\n#{sUnlocked}";
|
||||
if (ptr.getCellRef().getTrap() != ESM::RefId::sEmpty)
|
||||
if (ptr.getCellRef().getTrap() != ESM::RefId())
|
||||
text += "\n#{sTrapped}";
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
|
@ -166,7 +166,7 @@ namespace MWClass
|
||||
// using a key disarms the trap
|
||||
if (isTrapped)
|
||||
{
|
||||
ptr.getCellRef().setTrap(ESM::RefId::sEmpty);
|
||||
ptr.getCellRef().setTrap(ESM::RefId());
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(
|
||||
ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f);
|
||||
isTrapped = false;
|
||||
|
@ -264,7 +264,7 @@ namespace MWClass
|
||||
const MWWorld::LiveCellRef<ESM::Weapon>* ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
ESM::Weapon newItem = *ref->mBase;
|
||||
newItem.mId = ESM::RefId::sEmpty;
|
||||
newItem.mId = ESM::RefId();
|
||||
newItem.mName = newName;
|
||||
newItem.mData.mEnchant = enchCharge;
|
||||
newItem.mEnchant = enchId;
|
||||
|
@ -139,7 +139,7 @@ namespace MWDialogue
|
||||
if (actor.getClass().getCreatureStats(actor).isDead())
|
||||
return false;
|
||||
|
||||
mLastTopic = ESM::RefId::sEmpty;
|
||||
mLastTopic = ESM::RefId();
|
||||
// Note that we intentionally don't reset mPermanentDispositionChange
|
||||
|
||||
mChoice = -1;
|
||||
|
@ -19,7 +19,7 @@ namespace MWDialogue
|
||||
|
||||
Topic& getTopic(const ESM::RefId& id);
|
||||
|
||||
bool isThere(const ESM::RefId& topicId, const ESM::RefId& infoId = ESM::RefId::sEmpty) const;
|
||||
bool isThere(const ESM::RefId& topicId, const ESM::RefId& infoId = ESM::RefId()) const;
|
||||
|
||||
public:
|
||||
Journal();
|
||||
|
@ -248,7 +248,7 @@ namespace MWGui
|
||||
break;
|
||||
case GM_ClassGenerate:
|
||||
mGenerateClassStep = 0;
|
||||
mGenerateClass = ESM::RefId::sEmpty;
|
||||
mGenerateClass = ESM::RefId();
|
||||
mGenerateClassSpecializations[0] = 0;
|
||||
mGenerateClassSpecializations[1] = 0;
|
||||
mGenerateClassSpecializations[2] = 0;
|
||||
|
@ -54,7 +54,7 @@ namespace MWGui
|
||||
dropped = world->placeObject(item.mBase, mLeft, mTop, count);
|
||||
else
|
||||
dropped = world->dropObjectOnGround(world->getPlayerPtr(), item.mBase, count);
|
||||
dropped.getCellRef().setOwner(ESM::RefId::sEmpty);
|
||||
dropped.getCellRef().setOwner(ESM::RefId());
|
||||
|
||||
return dropped;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ namespace MWGui
|
||||
if (pickpocket.finish())
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager()->commitCrime(
|
||||
player, mActor, MWBase::MechanicsManager::OT_Pickpocket, ESM::RefId::sEmpty, 0, true);
|
||||
player, mActor, MWBase::MechanicsManager::OT_Pickpocket, ESM::RefId(), 0, true);
|
||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
|
||||
mPickpocketDetected = true;
|
||||
}
|
||||
@ -128,7 +128,7 @@ namespace MWGui
|
||||
if (pickpocket.pick(item, count))
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager()->commitCrime(
|
||||
player, mActor, MWBase::MechanicsManager::OT_Pickpocket, ESM::RefId::sEmpty, 0, true);
|
||||
player, mActor, MWBase::MechanicsManager::OT_Pickpocket, ESM::RefId(), 0, true);
|
||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
|
||||
mPickpocketDetected = true;
|
||||
return false;
|
||||
|
@ -144,7 +144,7 @@ namespace MWGui
|
||||
else
|
||||
{
|
||||
key->type = Type_Unassigned;
|
||||
key->id = ESM::RefId::sEmpty;
|
||||
key->id = ESM::RefId();
|
||||
key->name.clear();
|
||||
|
||||
MyGUI::TextBox* textBox = key->button->createWidgetReal<MyGUI::TextBox>(
|
||||
|
@ -55,19 +55,11 @@ namespace MWGui
|
||||
private:
|
||||
struct keyData
|
||||
{
|
||||
int index;
|
||||
ItemWidget* button;
|
||||
QuickKeysMenu::QuickKeyType type;
|
||||
int index = -1;
|
||||
ItemWidget* button = nullptr;
|
||||
QuickKeysMenu::QuickKeyType type = Type_Unassigned;
|
||||
ESM::RefId id;
|
||||
std::string name;
|
||||
keyData()
|
||||
: index(-1)
|
||||
, button(nullptr)
|
||||
, type(Type_Unassigned)
|
||||
, id(ESM::RefId::sEmpty)
|
||||
, name("")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
std::vector<keyData> mKey;
|
||||
|
@ -267,7 +267,7 @@ namespace MWGui
|
||||
if ((mFilter & Filter_OnlyEnchanted) && !(item.mFlags & ItemStack::Flag_Enchanted))
|
||||
return false;
|
||||
if ((mFilter & Filter_OnlyChargedSoulstones)
|
||||
&& (base.getType() != ESM::Miscellaneous::sRecordId || base.getCellRef().getSoul() == ESM::RefId::sEmpty
|
||||
&& (base.getType() != ESM::Miscellaneous::sRecordId || base.getCellRef().getSoul().empty()
|
||||
|| !MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(
|
||||
base.getCellRef().getSoul())))
|
||||
return false;
|
||||
|
@ -1367,7 +1367,7 @@ namespace MWGui
|
||||
void WindowManager::setSelectedEnchantItem(const MWWorld::Ptr& item)
|
||||
{
|
||||
mSelectedEnchantItem = item;
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mSelectedSpell = ESM::RefId();
|
||||
const ESM::Enchantment* ench = mStore->get<ESM::Enchantment>().find(item.getClass().getEnchantment(item));
|
||||
|
||||
int chargePercent
|
||||
@ -1400,7 +1400,7 @@ namespace MWGui
|
||||
|
||||
void WindowManager::unsetSelectedSpell()
|
||||
{
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mSelectedSpell = ESM::RefId();
|
||||
mSelectedEnchantItem = MWWorld::Ptr();
|
||||
mHud->unsetSelectedSpell();
|
||||
|
||||
@ -1794,7 +1794,7 @@ namespace MWGui
|
||||
|
||||
mToolTips->clear();
|
||||
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mSelectedSpell = ESM::RefId();
|
||||
mCustomMarkers.clear();
|
||||
|
||||
mForceHidden = GW_None;
|
||||
|
@ -73,7 +73,7 @@ namespace MWMechanics
|
||||
|
||||
void ActionEnchantedItem::prepare(const MWWorld::Ptr& actor)
|
||||
{
|
||||
actor.getClass().getCreatureStats(actor).getSpells().setSelectedSpell(ESM::RefId::sEmpty);
|
||||
actor.getClass().getCreatureStats(actor).getSpells().setSelectedSpell(ESM::RefId());
|
||||
actor.getClass().getInventoryStore(actor).setSelectedEnchantItem(mItem);
|
||||
actor.getClass().getCreatureStats(actor).setDrawState(DrawState::Spell);
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ MWMechanics::AiPackage::AiPackage(AiPackageTypeId typeId, const Options& options
|
||||
: mTypeId(typeId)
|
||||
, mOptions(options)
|
||||
, mReaction(MWBase::Environment::get().getWorld()->getPrng())
|
||||
, mTargetActorRefId(ESM::RefId::sEmpty)
|
||||
, mTargetActorId(-1)
|
||||
, mCachedTarget()
|
||||
, mRotateOnTheRunChecks(0)
|
||||
|
@ -56,7 +56,7 @@ namespace MWMechanics
|
||||
caps.mLimit = iAutoSpellSchoolMax[i];
|
||||
caps.mReachedLimit = iAutoSpellSchoolMax[i] <= 0;
|
||||
caps.mMinCost = std::numeric_limits<int>::max();
|
||||
caps.mWeakestSpell = ESM::RefId::sEmpty;
|
||||
caps.mWeakestSpell = ESM::RefId();
|
||||
schoolCaps[i] = caps;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ namespace MWMechanics
|
||||
|
||||
void CreatureStats::clearLastHitObject()
|
||||
{
|
||||
mLastHitObject = ESM::RefId::sEmpty;
|
||||
mLastHitObject = ESM::RefId();
|
||||
}
|
||||
|
||||
const ESM::RefId& CreatureStats::getLastHitObject() const
|
||||
@ -386,7 +386,7 @@ namespace MWMechanics
|
||||
|
||||
void CreatureStats::clearLastHitAttemptObject()
|
||||
{
|
||||
mLastHitAttemptObject = ESM::RefId::sEmpty;
|
||||
mLastHitAttemptObject = ESM::RefId();
|
||||
}
|
||||
|
||||
const ESM::RefId& CreatureStats::getLastHitAttemptObject() const
|
||||
|
@ -300,7 +300,7 @@ namespace MWMechanics
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
if (soulEmpty())
|
||||
return 0;
|
||||
if (mSoulGemPtr.getCellRef().getSoul() == ESM::RefId::sEmpty)
|
||||
if (mSoulGemPtr.getCellRef().getSoul().empty())
|
||||
return 0;
|
||||
const ESM::Creature* soul = store.get<ESM::Creature>().search(mSoulGemPtr.getCellRef().getSoul());
|
||||
if (soul)
|
||||
|
@ -1188,7 +1188,7 @@ namespace MWMechanics
|
||||
bool reported = false;
|
||||
if (victim.getClass().isClass(victim, "guard")
|
||||
&& !victim.getClass().getCreatureStats(victim).getAiSequence().hasPackage(AiPackageTypeId::Pursue))
|
||||
reported = reportCrime(player, victim, type, ESM::RefId::sEmpty, arg);
|
||||
reported = reportCrime(player, victim, type, ESM::RefId(), arg);
|
||||
|
||||
if (!reported)
|
||||
startCombat(victim,
|
||||
|
@ -112,7 +112,7 @@ namespace MWMechanics
|
||||
* @return was the crime seen?
|
||||
*/
|
||||
bool commitCrime(const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim, OffenseType type,
|
||||
const ESM::RefId& factionId = ESM::RefId::sEmpty, int arg = 0, bool victimAware = false) override;
|
||||
const ESM::RefId& factionId = ESM::RefId(), int arg = 0, bool victimAware = false) override;
|
||||
/// @return false if the attack was considered a "friendly hit" and forgiven
|
||||
bool actorAttacked(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) override;
|
||||
|
||||
|
@ -112,7 +112,7 @@ namespace MWMechanics
|
||||
auto& prng = MWBase::Environment::get().getWorld()->getPrng();
|
||||
if (Misc::Rng::roll0to99(prng) <= x)
|
||||
{
|
||||
trap.getCellRef().setTrap(ESM::RefId::sEmpty);
|
||||
trap.getCellRef().setTrap(ESM::RefId());
|
||||
|
||||
resultSound = "Disarm Trap";
|
||||
resultMessage = "#{sTrapSuccess}";
|
||||
|
@ -83,7 +83,7 @@ namespace MWMechanics
|
||||
mSpellList->remove(spell);
|
||||
|
||||
if (spellId == mSelectedSpell)
|
||||
mSelectedSpell = ESM::RefId::sEmpty;
|
||||
mSelectedSpell = ESM::RefId();
|
||||
}
|
||||
|
||||
void Spells::removeSpell(const ESM::Spell* spell)
|
||||
|
@ -30,7 +30,7 @@ namespace MWScript
|
||||
/// If \a id is empty, a reference the script is run from is returned or in case
|
||||
/// of a non-local script the reference derived from the target ID.
|
||||
const MWWorld::Ptr getReferenceImp(
|
||||
const ESM::RefId& id = ESM::RefId::sEmpty, bool activeOnly = false, bool doThrow = true) const;
|
||||
const ESM::RefId& id = ESM::RefId(), bool activeOnly = false, bool doThrow = true) const;
|
||||
|
||||
const Locals& getMemberLocals(std::reference_wrapper<const ESM::RefId>& id, bool global) const;
|
||||
///< \a id is changed to the respective script ID, if \a id wasn't a script ID before
|
||||
|
@ -716,7 +716,7 @@ namespace MWScript
|
||||
int removed = store.remove(*iter, amount);
|
||||
MWWorld::Ptr dropped
|
||||
= MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, removed);
|
||||
dropped.getCellRef().setOwner(ESM::RefId::sEmpty);
|
||||
dropped.getCellRef().setOwner(ESM::RefId());
|
||||
|
||||
amount -= removed;
|
||||
|
||||
|
@ -31,6 +31,6 @@ namespace MWWorld
|
||||
cast.mHitPosition = actorPosition;
|
||||
cast.cast(mSpellId);
|
||||
}
|
||||
mTrapSource.getCellRef().setTrap(ESM::RefId::sEmpty);
|
||||
mTrapSource.getCellRef().setTrap(ESM::RefId());
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace MWWorld
|
||||
, mGridPos(cell.mX, cell.mY)
|
||||
, mDisplayname(cell.mFullName)
|
||||
, mNameID(cell.mEditorId)
|
||||
, mRegion(ESM::RefId::sEmpty) // Unimplemented for now
|
||||
, mRegion(ESM::RefId()) // Unimplemented for now
|
||||
, mCellId{
|
||||
.mWorldspace{ Misc::StringUtils::lowerCase(cell.mEditorId) },
|
||||
.mIndex{ cell.getGridX(), cell.getGridY() },
|
||||
|
@ -320,9 +320,9 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add(
|
||||
item.getCellRef().setPosition(pos);
|
||||
|
||||
// We do not need to store owners for items in container stores - we do not use it anyway.
|
||||
item.getCellRef().setOwner(ESM::RefId::sEmpty);
|
||||
item.getCellRef().setOwner(ESM::RefId());
|
||||
item.getCellRef().resetGlobalVariable();
|
||||
item.getCellRef().setFaction(ESM::RefId::sEmpty);
|
||||
item.getCellRef().setFaction(ESM::RefId());
|
||||
item.getCellRef().setFactionRank(-2);
|
||||
|
||||
// must reset the RefNum on the copied item, so that the RefNum on the original item stays unique
|
||||
@ -675,7 +675,7 @@ void MWWorld::ContainerStore::resolve()
|
||||
for (const auto&& ptr : *this)
|
||||
ptr.getRefData().setCount(0);
|
||||
Misc::Rng::Generator prng{ mSeed };
|
||||
fill(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId::sEmpty, prng);
|
||||
fill(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId(), prng);
|
||||
addScripts(*this, mPtr.mCell);
|
||||
}
|
||||
mModified = true;
|
||||
@ -696,7 +696,7 @@ MWWorld::ResolutionHandle MWWorld::ContainerStore::resolveTemporarily()
|
||||
for (const auto&& ptr : *this)
|
||||
ptr.getRefData().setCount(0);
|
||||
Misc::Rng::Generator prng{ mSeed };
|
||||
fill(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId::sEmpty, prng);
|
||||
fill(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId(), prng);
|
||||
addScripts(*this, mPtr.mCell);
|
||||
}
|
||||
return { listener };
|
||||
@ -711,7 +711,7 @@ void MWWorld::ContainerStore::unresolve()
|
||||
{
|
||||
for (const auto&& ptr : *this)
|
||||
ptr.getRefData().setCount(0);
|
||||
fillNonRandom(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId::sEmpty, mSeed);
|
||||
fillNonRandom(mPtr.get<ESM::Container>()->mBase->mInventory, ESM::RefId(), mSeed);
|
||||
addScripts(*this, mPtr.mCell);
|
||||
mResolved = false;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace
|
||||
{
|
||||
Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '"
|
||||
<< npc.mFaction << "', ignoring it.";
|
||||
npc.mFaction = ESM::RefId::sEmpty;
|
||||
npc.mFaction = ESM::RefId();
|
||||
npc.mNpdt.mRank = 0;
|
||||
changed = true;
|
||||
}
|
||||
@ -142,7 +142,7 @@ namespace
|
||||
{
|
||||
if (!item.mScript.empty() && !scripts.search(item.mScript))
|
||||
{
|
||||
item.mScript = ESM::RefId::sEmpty;
|
||||
item.mScript = ESM::RefId();
|
||||
Log(Debug::Verbose) << "Item '" << id << "' (" << item.mName << ") has nonexistent script '"
|
||||
<< item.mScript << "', ignoring it.";
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void MWWorld::LiveCellRefBase::loadImp(const ESM::ObjectState& state)
|
||||
&& !MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(mRef.getSoul()))
|
||||
{
|
||||
Log(Debug::Warning) << "Soul '" << mRef.getSoul() << "' not found, removing the soul from soul gem";
|
||||
mRef.setSoul(ESM::RefId::sEmpty);
|
||||
mRef.setSoul(ESM::RefId());
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getLuaManager()->loadLocalScripts(ptr, state.mLuaScripts);
|
||||
|
@ -251,7 +251,7 @@ namespace MWWorld
|
||||
void Player::clear()
|
||||
{
|
||||
mCellStore = nullptr;
|
||||
mSign = ESM::RefId::sEmpty;
|
||||
mSign = ESM::RefId();
|
||||
mMarkedCell = nullptr;
|
||||
mTeleported = false;
|
||||
mJumping = false;
|
||||
|
@ -92,7 +92,7 @@ namespace MWWorld
|
||||
|
||||
~RefData();
|
||||
|
||||
void write(ESM::ObjectState& objectState, const ESM::RefId& scriptId = ESM::RefId::sEmpty) const;
|
||||
void write(ESM::ObjectState& objectState, const ESM::RefId& scriptId = ESM::RefId()) const;
|
||||
///< Ignores custom data (not enough context available here to
|
||||
/// perform this operations).
|
||||
|
||||
|
@ -454,7 +454,7 @@ namespace MWWorld
|
||||
else
|
||||
mStatic.insert(it, std::move(land));
|
||||
|
||||
return RecordId(ESM::RefId::sEmpty, isDeleted);
|
||||
return RecordId(ESM::RefId(), isDeleted);
|
||||
}
|
||||
void Store<ESM::Land>::setUp()
|
||||
{
|
||||
@ -898,7 +898,7 @@ namespace MWWorld
|
||||
mExt.erase(it);
|
||||
}
|
||||
|
||||
return RecordId(ESM::RefId::sEmpty, isDeleted);
|
||||
return RecordId(ESM::RefId(), isDeleted);
|
||||
}
|
||||
|
||||
// Try to overwrite existing record
|
||||
@ -916,7 +916,7 @@ namespace MWWorld
|
||||
ret.first->second = pathgrid;
|
||||
}
|
||||
|
||||
return RecordId(ESM::RefId::sEmpty, isDeleted);
|
||||
return RecordId(ESM::RefId(), isDeleted);
|
||||
}
|
||||
size_t Store<ESM::Pathgrid>::getSize() const
|
||||
{
|
||||
|
@ -211,7 +211,7 @@ namespace MWWorld
|
||||
= ESM::RefId::stringRefId(Fallback::Map::getString("Weather_" + name + "_Ambient_Loop_Sound_ID"));
|
||||
|
||||
if (mAmbientLoopSoundID == "None")
|
||||
mAmbientLoopSoundID = ESM::RefId::sEmpty;
|
||||
mAmbientLoopSoundID = ESM::RefId();
|
||||
}
|
||||
|
||||
float Weather::transitionDelta() const
|
||||
@ -834,7 +834,7 @@ namespace MWWorld
|
||||
if (mAmbientSound)
|
||||
MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound);
|
||||
mAmbientSound = nullptr;
|
||||
mPlayingSoundID = ESM::RefId::sEmpty;
|
||||
mPlayingSoundID = ESM::RefId();
|
||||
}
|
||||
|
||||
float WeatherManager::getWindSpeed() const
|
||||
@ -964,7 +964,7 @@ namespace MWWorld
|
||||
{
|
||||
stopSounds();
|
||||
|
||||
mCurrentRegion = ESM::RefId::sEmpty;
|
||||
mCurrentRegion = ESM::RefId();
|
||||
mTimePassed = 0.0f;
|
||||
mWeatherUpdateTime = 0.0f;
|
||||
forceWeather(0);
|
||||
|
@ -93,7 +93,7 @@ void MWWorld::WorldModel::clear()
|
||||
mLastGeneratedRefnum = ESM::RefNum{};
|
||||
mInteriors.clear();
|
||||
mExteriors.clear();
|
||||
std::fill(mIdCache.begin(), mIdCache.end(), std::make_pair(ESM::RefId::sEmpty, (MWWorld::CellStore*)nullptr));
|
||||
std::fill(mIdCache.begin(), mIdCache.end(), std::make_pair(ESM::RefId(), (MWWorld::CellStore*)nullptr));
|
||||
mIdCacheIndex = 0;
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ MWWorld::WorldModel::WorldModel(const MWWorld::ESMStore& store, ESM::ReadersCach
|
||||
, mPtrIndexUpdateCounter(0)
|
||||
{
|
||||
int cacheSize = std::clamp(Settings::Manager::getInt("pointers cache size", "Cells"), 40, 1000);
|
||||
mIdCache = IdCache(cacheSize, std::pair<ESM::RefId, CellStore*>(ESM::RefId::sEmpty, (CellStore*)nullptr));
|
||||
mIdCache = IdCache(cacheSize, std::pair<ESM::RefId, CellStore*>(ESM::RefId(), (CellStore*)nullptr));
|
||||
}
|
||||
|
||||
MWWorld::CellStore* MWWorld::WorldModel::getExterior(int x, int y)
|
||||
|
@ -297,7 +297,7 @@ CUSTOM, PLAYER: useInterface.lua
|
||||
TEST_F(LuaScriptsContainerTest, Interface)
|
||||
{
|
||||
LuaUtil::ScriptsContainer scripts(&mLua, "Test");
|
||||
scripts.setAutoStartConf(mCfg.getLocalConf(ESM::REC_CREA, ESM::RefId::sEmpty, ESM::RefNum()));
|
||||
scripts.setAutoStartConf(mCfg.getLocalConf(ESM::REC_CREA, ESM::RefId(), ESM::RefNum()));
|
||||
int addIfaceId = *mCfg.findId("testInterface.lua");
|
||||
int overrideIfaceId = *mCfg.findId("overrideInterface.lua");
|
||||
int useIfaceId = *mCfg.findId("useInterface.lua");
|
||||
@ -327,8 +327,8 @@ CUSTOM, PLAYER: useInterface.lua
|
||||
LuaUtil::ScriptsContainer scripts1(&mLua, "Test");
|
||||
LuaUtil::ScriptsContainer scripts2(&mLua, "Test");
|
||||
LuaUtil::ScriptsContainer scripts3(&mLua, "Test");
|
||||
scripts1.setAutoStartConf(mCfg.getLocalConf(ESM::REC_NPC_, ESM::RefId::sEmpty, ESM::RefNum()));
|
||||
scripts2.setAutoStartConf(mCfg.getLocalConf(ESM::REC_NPC_, ESM::RefId::sEmpty, ESM::RefNum()));
|
||||
scripts1.setAutoStartConf(mCfg.getLocalConf(ESM::REC_NPC_, ESM::RefId(), ESM::RefNum()));
|
||||
scripts2.setAutoStartConf(mCfg.getLocalConf(ESM::REC_NPC_, ESM::RefId(), ESM::RefNum()));
|
||||
scripts3.setAutoStartConf(mCfg.getPlayerConf());
|
||||
|
||||
scripts1.addAutoStartedScripts();
|
||||
|
@ -148,7 +148,7 @@ namespace ESM
|
||||
if (cellRef.mLockLevel == 0 && !cellRef.mKey.empty())
|
||||
{
|
||||
cellRef.mLockLevel = UnbreakableLock;
|
||||
cellRef.mTrap = ESM::RefId::sEmpty;
|
||||
cellRef.mTrap = ESM::RefId();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -259,12 +259,12 @@ namespace ESM
|
||||
void CellRef::blank()
|
||||
{
|
||||
mRefNum = RefNum{};
|
||||
mRefID = ESM::RefId::sEmpty;
|
||||
mRefID = ESM::RefId();
|
||||
mScale = 1;
|
||||
mOwner = ESM::RefId::sEmpty;
|
||||
mOwner = ESM::RefId();
|
||||
mGlobalVariable.clear();
|
||||
mSoul = ESM::RefId::sEmpty;
|
||||
mFaction = ESM::RefId::sEmpty;
|
||||
mSoul = ESM::RefId();
|
||||
mFaction = ESM::RefId();
|
||||
mFactionRank = -2;
|
||||
mChargeInt = -1;
|
||||
mChargeIntRemainder = 0.0f;
|
||||
@ -272,8 +272,8 @@ namespace ESM
|
||||
mGoldValue = 1;
|
||||
mDestCell.clear();
|
||||
mLockLevel = 0;
|
||||
mKey = ESM::RefId::sEmpty;
|
||||
mTrap = ESM::RefId::sEmpty;
|
||||
mKey = ESM::RefId();
|
||||
mTrap = ESM::RefId();
|
||||
mReferenceBlocked = -1;
|
||||
mTeleport = false;
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace ESM
|
||||
{
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mModel.clear();
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mEffects.mList.clear();
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ namespace ESM
|
||||
mData.mValue = 0;
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mName.clear();
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mEnchant = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,6 @@ namespace ESM
|
||||
mData.mType = 0;
|
||||
|
||||
mModel.clear();
|
||||
mRace = ESM::RefId::sEmpty;
|
||||
mRace = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -88,8 +88,8 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mEnchant = ESM::RefId();
|
||||
mText.clear();
|
||||
}
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ namespace ESM
|
||||
void Cell::blank()
|
||||
{
|
||||
mName = "";
|
||||
mRegion = ESM::RefId::sEmpty;
|
||||
mRegion = ESM::RefId();
|
||||
mWater = 0;
|
||||
mWaterInt = false;
|
||||
mMapColor = 0;
|
||||
|
@ -94,7 +94,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId();
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ namespace ESM
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
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 = ESM::RefId::sEmpty;
|
||||
mOriginal = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mOriginal = ESM::RefId();
|
||||
mInventory.mList.clear();
|
||||
mSpells.mList.clear();
|
||||
mAiData.blank();
|
||||
|
@ -71,8 +71,8 @@ namespace ESM
|
||||
mRecordFlags = 0;
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mOpenSound = ESM::RefId::sEmpty;
|
||||
mCloseSound = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
mOpenSound = ESM::RefId();
|
||||
mCloseSound = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -140,14 +140,14 @@ namespace ESM
|
||||
mData = {};
|
||||
|
||||
mSelects.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;
|
||||
mPrev = ESM::RefId();
|
||||
mNext = ESM::RefId();
|
||||
mActor = ESM::RefId();
|
||||
mRace = ESM::RefId();
|
||||
mClass = ESM::RefId();
|
||||
mFaction = ESM::RefId();
|
||||
mPcFaction = ESM::RefId();
|
||||
mCell = ESM::RefId();
|
||||
mSound.clear();
|
||||
mResponse.clear();
|
||||
mResultScript.clear();
|
||||
|
@ -102,6 +102,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ namespace ESM
|
||||
mData.mRadius = 0;
|
||||
mData.mColor = 0;
|
||||
mData.mFlags = 0;
|
||||
mSound = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mSound = ESM::RefId();
|
||||
mScript = ESM::RefId();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mName.clear();
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace ESM
|
||||
|
||||
void LandTexture::blank()
|
||||
{
|
||||
mId = ESM::RefId::sEmpty;
|
||||
mId = ESM::RefId();
|
||||
mTexture.clear();
|
||||
}
|
||||
}
|
||||
|
@ -581,14 +581,14 @@ namespace ESM
|
||||
|
||||
mIcon.clear();
|
||||
mParticle.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;
|
||||
mCasting = ESM::RefId();
|
||||
mHit = ESM::RefId();
|
||||
mArea = ESM::RefId();
|
||||
mBolt = ESM::RefId();
|
||||
mCastSound = ESM::RefId();
|
||||
mBoltSound = ESM::RefId();
|
||||
mHitSound = ESM::RefId();
|
||||
mAreaSound = ESM::RefId();
|
||||
mDescription.clear();
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -202,12 +202,12 @@ namespace ESM
|
||||
mAiPackage.mList.clear();
|
||||
mName.clear();
|
||||
mModel.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;
|
||||
mRace = ESM::RefId();
|
||||
mClass = ESM::RefId();
|
||||
mFaction = ESM::RefId();
|
||||
mScript = ESM::RefId();
|
||||
mHair = ESM::RefId();
|
||||
mHead = ESM::RefId();
|
||||
}
|
||||
|
||||
void NPC::blankNpdt()
|
||||
|
@ -186,7 +186,7 @@ namespace ESM
|
||||
|
||||
void Pathgrid::blank()
|
||||
{
|
||||
mCell = ESM::RefId::sEmpty;
|
||||
mCell = ESM::RefId();
|
||||
mData.mX = 0;
|
||||
mData.mY = 0;
|
||||
mData.mS1 = 0;
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace ESM
|
||||
mMapColor = 0;
|
||||
|
||||
mName.clear();
|
||||
mSleepList = ESM::RefId::sEmpty;
|
||||
mSleepList = ESM::RefId();
|
||||
mSoundList.clear();
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,6 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace ESM
|
||||
{
|
||||
mRecordFlags = 0;
|
||||
mType = LeftFoot;
|
||||
mCreature = ESM::RefId::sEmpty;
|
||||
mSound = ESM::RefId::sEmpty;
|
||||
mCreature = ESM::RefId();
|
||||
mSound = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ namespace ESM
|
||||
mName.clear();
|
||||
mModel.clear();
|
||||
mIcon.clear();
|
||||
mEnchant = ESM::RefId::sEmpty;
|
||||
mScript = ESM::RefId::sEmpty;
|
||||
mEnchant = ESM::RefId();
|
||||
mScript = ESM::RefId();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user