From b5ec584be2f6be096fd043ca5dc3b8a20b21a9da Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 17 Feb 2023 19:20:29 +0100 Subject: [PATCH] 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. --- apps/opencs/model/doc/savingstages.cpp | 4 ++-- apps/opencs/model/tools/scriptcheck.cpp | 2 +- apps/opencs/model/world/actoradapter.cpp | 6 +++--- apps/opencs/model/world/nestedcoladapterimp.cpp | 4 ++-- apps/opencs/model/world/refcollection.cpp | 6 +++--- apps/opencs/model/world/refidadapterimp.hpp | 6 +++--- apps/openmw/mwbase/mechanicsmanager.hpp | 2 +- apps/openmw/mwclass/armor.cpp | 2 +- apps/openmw/mwclass/book.cpp | 2 +- apps/openmw/mwclass/clothing.cpp | 2 +- apps/openmw/mwclass/container.cpp | 6 +++--- apps/openmw/mwclass/door.cpp | 2 +- apps/openmw/mwclass/weapon.cpp | 2 +- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 2 +- apps/openmw/mwdialogue/journalimp.hpp | 2 +- apps/openmw/mwgui/charactercreation.cpp | 2 +- apps/openmw/mwgui/hud.cpp | 2 +- apps/openmw/mwgui/pickpocketitemmodel.cpp | 4 ++-- apps/openmw/mwgui/quickkeysmenu.cpp | 2 +- apps/openmw/mwgui/quickkeysmenu.hpp | 14 +++----------- apps/openmw/mwgui/sortfilteritemmodel.cpp | 2 +- apps/openmw/mwgui/windowmanagerimp.cpp | 6 +++--- apps/openmw/mwmechanics/aicombataction.cpp | 2 +- apps/openmw/mwmechanics/aipackage.cpp | 1 - apps/openmw/mwmechanics/autocalcspell.cpp | 2 +- apps/openmw/mwmechanics/creaturestats.cpp | 4 ++-- apps/openmw/mwmechanics/enchanting.cpp | 2 +- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 2 +- apps/openmw/mwmechanics/mechanicsmanagerimp.hpp | 2 +- apps/openmw/mwmechanics/security.cpp | 2 +- apps/openmw/mwmechanics/spells.cpp | 2 +- apps/openmw/mwscript/interpretercontext.hpp | 2 +- apps/openmw/mwscript/miscextensions.cpp | 2 +- apps/openmw/mwworld/actiontrap.cpp | 2 +- apps/openmw/mwworld/cell.cpp | 2 +- apps/openmw/mwworld/containerstore.cpp | 10 +++++----- apps/openmw/mwworld/esmstore.cpp | 4 ++-- apps/openmw/mwworld/livecellref.cpp | 2 +- apps/openmw/mwworld/player.cpp | 2 +- apps/openmw/mwworld/refdata.hpp | 2 +- apps/openmw/mwworld/store.cpp | 6 +++--- apps/openmw/mwworld/weather.cpp | 6 +++--- apps/openmw/mwworld/worldmodel.cpp | 4 ++-- .../lua/test_scriptscontainer.cpp | 6 +++--- components/esm3/cellref.cpp | 14 +++++++------- components/esm3/loadacti.cpp | 2 +- components/esm3/loadalch.cpp | 2 +- components/esm3/loadappa.cpp | 2 +- components/esm3/loadarmo.cpp | 4 ++-- components/esm3/loadbody.cpp | 2 +- components/esm3/loadbook.cpp | 4 ++-- components/esm3/loadcell.cpp | 2 +- components/esm3/loadclot.cpp | 4 ++-- components/esm3/loadcont.cpp | 2 +- components/esm3/loadcrea.cpp | 4 ++-- components/esm3/loaddoor.cpp | 6 +++--- components/esm3/loadinfo.cpp | 16 ++++++++-------- components/esm3/loadingr.cpp | 2 +- components/esm3/loadligh.cpp | 4 ++-- components/esm3/loadlock.cpp | 2 +- components/esm3/loadltex.cpp | 2 +- components/esm3/loadmgef.cpp | 16 ++++++++-------- components/esm3/loadmisc.cpp | 2 +- components/esm3/loadnpc.cpp | 12 ++++++------ components/esm3/loadpgrd.cpp | 2 +- components/esm3/loadprob.cpp | 2 +- components/esm3/loadregn.cpp | 2 +- components/esm3/loadrepa.cpp | 2 +- components/esm3/loadsndg.cpp | 4 ++-- components/esm3/loadweap.cpp | 4 ++-- 70 files changed, 131 insertions(+), 140 deletions(-) diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index 86075ce8d6..90d01b48e9 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -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; diff --git a/apps/opencs/model/tools/scriptcheck.cpp b/apps/opencs/model/tools/scriptcheck.cpp index 644bb3c08c..b97f829e53 100644 --- a/apps/opencs/model/tools/scriptcheck.cpp +++ b/apps/opencs/model/tools/scriptcheck.cpp @@ -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(); diff --git a/apps/opencs/model/world/actoradapter.cpp b/apps/opencs/model/world/actoradapter.cpp index a47b216236..31b94d4e0b 100644 --- a/apps/opencs/model/world/actoradapter.cpp +++ b/apps/opencs/model/world/actoradapter.cpp @@ -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); } }; diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 146354e854..90525c8f60 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -255,7 +255,7 @@ namespace CSMWorld std::map& 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); diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 659606fb58..5b0080a388 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -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 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.get())->get().mIdNum, index)); @@ -338,7 +338,7 @@ void CSMWorld::RefCollection::appendRecord(std::unique_ptr record, U void CSMWorld::RefCollection::insertRecord(std::unique_ptr 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.get())->get().mIdNum; Collection>::insertRecord(std::move(record), index, type); // add records only diff --git a/apps/opencs/model/world/refidadapterimp.hpp b/apps/opencs/model/world/refidadapterimp.hpp index 014952f7f6..6ed23670f7 100644 --- a/apps/opencs/model/world/refidadapterimp.hpp +++ b/apps/opencs/model/world/refidadapterimp.hpp @@ -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& list = leveled.mList; ESM::LevelledListBase::LevelItem newItem; - newItem.mId = ESM::RefId::sEmpty; + newItem.mId = ESM::RefId(); newItem.mLevel = 0; if (position >= (int)list.size()) diff --git a/apps/openmw/mwbase/mechanicsmanager.hpp b/apps/openmw/mwbase/mechanicsmanager.hpp index 8427711689..5688f6cbed 100644 --- a/apps/openmw/mwbase/mechanicsmanager.hpp +++ b/apps/openmw/mwbase/mechanicsmanager.hpp @@ -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; diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index 2825b3e1d7..a7a19bcfb3 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -285,7 +285,7 @@ namespace MWClass const MWWorld::LiveCellRef* ref = ptr.get(); ESM::Armor newItem = *ref->mBase; - newItem.mId = ESM::RefId::sEmpty; + newItem.mId = ESM::RefId(); newItem.mName = newName; newItem.mData.mEnchant = enchCharge; newItem.mEnchant = enchId; diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp index df00970f5f..27b4a28a22 100644 --- a/apps/openmw/mwclass/book.cpp +++ b/apps/openmw/mwclass/book.cpp @@ -146,7 +146,7 @@ namespace MWClass const MWWorld::LiveCellRef* ref = ptr.get(); 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; diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp index 119b3aaeca..4a1c3019d8 100644 --- a/apps/openmw/mwclass/clothing.cpp +++ b/apps/openmw/mwclass/clothing.cpp @@ -192,7 +192,7 @@ namespace MWClass const MWWorld::LiveCellRef* ref = ptr.get(); ESM::Clothing newItem = *ref->mBase; - newItem.mId = ESM::RefId::sEmpty; + newItem.mId = ESM::RefId(); newItem.mName = newName; newItem.mData.mEnchant = enchCharge; newItem.mEnchant = enchId; diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 6023e0192a..47260c3ba4 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -42,7 +42,7 @@ namespace MWClass unsigned int seed = Misc::Rng::rollDice(std::numeric_limits::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()) diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 075b2cffa8..5d02b81367 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -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; diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index 832751adef..3a02581f62 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -264,7 +264,7 @@ namespace MWClass const MWWorld::LiveCellRef* ref = ptr.get(); ESM::Weapon newItem = *ref->mBase; - newItem.mId = ESM::RefId::sEmpty; + newItem.mId = ESM::RefId(); newItem.mName = newName; newItem.mData.mEnchant = enchCharge; newItem.mEnchant = enchId; diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index 436f9e6f2b..c82c6e2f5e 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -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; diff --git a/apps/openmw/mwdialogue/journalimp.hpp b/apps/openmw/mwdialogue/journalimp.hpp index a214c6f4ef..b7b0c3151c 100644 --- a/apps/openmw/mwdialogue/journalimp.hpp +++ b/apps/openmw/mwdialogue/journalimp.hpp @@ -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(); diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index fed0d88ff6..bc2d73dda7 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -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; diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 0a28972a2a..52227f2544 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -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; } diff --git a/apps/openmw/mwgui/pickpocketitemmodel.cpp b/apps/openmw/mwgui/pickpocketitemmodel.cpp index 0a9ae43e08..bfaf011835 100644 --- a/apps/openmw/mwgui/pickpocketitemmodel.cpp +++ b/apps/openmw/mwgui/pickpocketitemmodel.cpp @@ -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; diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index b2913e8f07..e9a80c6c63 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -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( diff --git a/apps/openmw/mwgui/quickkeysmenu.hpp b/apps/openmw/mwgui/quickkeysmenu.hpp index 5f82b98d57..27dee2ea14 100644 --- a/apps/openmw/mwgui/quickkeysmenu.hpp +++ b/apps/openmw/mwgui/quickkeysmenu.hpp @@ -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 mKey; diff --git a/apps/openmw/mwgui/sortfilteritemmodel.cpp b/apps/openmw/mwgui/sortfilteritemmodel.cpp index b6ec7a083a..780f2effc0 100644 --- a/apps/openmw/mwgui/sortfilteritemmodel.cpp +++ b/apps/openmw/mwgui/sortfilteritemmodel.cpp @@ -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().search( base.getCellRef().getSoul()))) return false; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index c2686ccc87..45efe08bd5 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -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().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; diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 4ac3c1cdeb..f41640323a 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -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); } diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index 6c1c4c7118..dec0661dd6 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -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) diff --git a/apps/openmw/mwmechanics/autocalcspell.cpp b/apps/openmw/mwmechanics/autocalcspell.cpp index 743ae1be91..3e88c3370d 100644 --- a/apps/openmw/mwmechanics/autocalcspell.cpp +++ b/apps/openmw/mwmechanics/autocalcspell.cpp @@ -56,7 +56,7 @@ namespace MWMechanics caps.mLimit = iAutoSpellSchoolMax[i]; caps.mReachedLimit = iAutoSpellSchoolMax[i] <= 0; caps.mMinCost = std::numeric_limits::max(); - caps.mWeakestSpell = ESM::RefId::sEmpty; + caps.mWeakestSpell = ESM::RefId(); schoolCaps[i] = caps; } diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 2b4ccc34bd..f742e3737a 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -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 diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 99648e0fc1..7121682176 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -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().search(mSoulGemPtr.getCellRef().getSoul()); if (soul) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 5cfa44c378..2e7581c469 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -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, diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp index 4dbd80391e..a5d2a45b4c 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp @@ -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; diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index cafe42e391..6b0f7fc110 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -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}"; diff --git a/apps/openmw/mwmechanics/spells.cpp b/apps/openmw/mwmechanics/spells.cpp index 9d3621a2a4..730aa70893 100644 --- a/apps/openmw/mwmechanics/spells.cpp +++ b/apps/openmw/mwmechanics/spells.cpp @@ -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) diff --git a/apps/openmw/mwscript/interpretercontext.hpp b/apps/openmw/mwscript/interpretercontext.hpp index 3db474e2ca..f8d0cbca62 100644 --- a/apps/openmw/mwscript/interpretercontext.hpp +++ b/apps/openmw/mwscript/interpretercontext.hpp @@ -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& id, bool global) const; ///< \a id is changed to the respective script ID, if \a id wasn't a script ID before diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index b8e6d2f16f..6d9313e97f 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -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; diff --git a/apps/openmw/mwworld/actiontrap.cpp b/apps/openmw/mwworld/actiontrap.cpp index 518f9b87f6..5a0e3c7b86 100644 --- a/apps/openmw/mwworld/actiontrap.cpp +++ b/apps/openmw/mwworld/actiontrap.cpp @@ -31,6 +31,6 @@ namespace MWWorld cast.mHitPosition = actorPosition; cast.cast(mSpellId); } - mTrapSource.getCellRef().setTrap(ESM::RefId::sEmpty); + mTrapSource.getCellRef().setTrap(ESM::RefId()); } } diff --git a/apps/openmw/mwworld/cell.cpp b/apps/openmw/mwworld/cell.cpp index 1dea1de399..dd91fd4758 100644 --- a/apps/openmw/mwworld/cell.cpp +++ b/apps/openmw/mwworld/cell.cpp @@ -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() }, diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 8d5ca4518c..3f0eaba440 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -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()->mBase->mInventory, ESM::RefId::sEmpty, prng); + fill(mPtr.get()->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()->mBase->mInventory, ESM::RefId::sEmpty, prng); + fill(mPtr.get()->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()->mBase->mInventory, ESM::RefId::sEmpty, mSeed); + fillNonRandom(mPtr.get()->mBase->mInventory, ESM::RefId(), mSeed); addScripts(*this, mPtr.mCell); mResolved = false; } diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 0227d6ede3..8448a092ac 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -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."; } diff --git a/apps/openmw/mwworld/livecellref.cpp b/apps/openmw/mwworld/livecellref.cpp index 7668f18de1..73678cf21d 100644 --- a/apps/openmw/mwworld/livecellref.cpp +++ b/apps/openmw/mwworld/livecellref.cpp @@ -65,7 +65,7 @@ void MWWorld::LiveCellRefBase::loadImp(const ESM::ObjectState& state) && !MWBase::Environment::get().getWorld()->getStore().get().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); diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 3fb99333d6..88faac3c52 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -251,7 +251,7 @@ namespace MWWorld void Player::clear() { mCellStore = nullptr; - mSign = ESM::RefId::sEmpty; + mSign = ESM::RefId(); mMarkedCell = nullptr; mTeleported = false; mJumping = false; diff --git a/apps/openmw/mwworld/refdata.hpp b/apps/openmw/mwworld/refdata.hpp index 0ceb951335..e067cc1456 100644 --- a/apps/openmw/mwworld/refdata.hpp +++ b/apps/openmw/mwworld/refdata.hpp @@ -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). diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index a8c49e9252..d3aa2a5ca9 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -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::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::getSize() const { diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 49159839e1..3338acd832 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -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); diff --git a/apps/openmw/mwworld/worldmodel.cpp b/apps/openmw/mwworld/worldmodel.cpp index c6d7d33ebb..35b67133f0 100644 --- a/apps/openmw/mwworld/worldmodel.cpp +++ b/apps/openmw/mwworld/worldmodel.cpp @@ -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::sEmpty, (CellStore*)nullptr)); + mIdCache = IdCache(cacheSize, std::pair(ESM::RefId(), (CellStore*)nullptr)); } MWWorld::CellStore* MWWorld::WorldModel::getExterior(int x, int y) diff --git a/apps/openmw_test_suite/lua/test_scriptscontainer.cpp b/apps/openmw_test_suite/lua/test_scriptscontainer.cpp index ae615fd4e5..1d5ebb0d16 100644 --- a/apps/openmw_test_suite/lua/test_scriptscontainer.cpp +++ b/apps/openmw_test_suite/lua/test_scriptscontainer.cpp @@ -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(); diff --git a/components/esm3/cellref.cpp b/components/esm3/cellref.cpp index a74c44270c..d9cef58a4b 100644 --- a/components/esm3/cellref.cpp +++ b/components/esm3/cellref.cpp @@ -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; diff --git a/components/esm3/loadacti.cpp b/components/esm3/loadacti.cpp index 0b5cc9267c..82fd6f3504 100644 --- a/components/esm3/loadacti.cpp +++ b/components/esm3/loadacti.cpp @@ -61,7 +61,7 @@ namespace ESM { mRecordFlags = 0; mName.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); mModel.clear(); } } diff --git a/components/esm3/loadalch.cpp b/components/esm3/loadalch.cpp index 5ab6000414..77ab53ef3a 100644 --- a/components/esm3/loadalch.cpp +++ b/components/esm3/loadalch.cpp @@ -84,7 +84,7 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); mEffects.mList.clear(); } } diff --git a/components/esm3/loadappa.cpp b/components/esm3/loadappa.cpp index da50aae4ea..f5c49dc856 100644 --- a/components/esm3/loadappa.cpp +++ b/components/esm3/loadappa.cpp @@ -79,7 +79,7 @@ namespace ESM mData.mValue = 0; mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); mName.clear(); } } diff --git a/components/esm3/loadarmo.cpp b/components/esm3/loadarmo.cpp index c6da2acfae..fb934f9856 100644 --- a/components/esm3/loadarmo.cpp +++ b/components/esm3/loadarmo.cpp @@ -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(); } } diff --git a/components/esm3/loadbody.cpp b/components/esm3/loadbody.cpp index 035edbb94c..89d7e3f051 100644 --- a/components/esm3/loadbody.cpp +++ b/components/esm3/loadbody.cpp @@ -71,6 +71,6 @@ namespace ESM mData.mType = 0; mModel.clear(); - mRace = ESM::RefId::sEmpty; + mRace = ESM::RefId(); } } diff --git a/components/esm3/loadbook.cpp b/components/esm3/loadbook.cpp index aa85b7d206..cc0e7d198c 100644 --- a/components/esm3/loadbook.cpp +++ b/components/esm3/loadbook.cpp @@ -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(); } } diff --git a/components/esm3/loadcell.cpp b/components/esm3/loadcell.cpp index 5e72646b56..a35db8cc1a 100644 --- a/components/esm3/loadcell.cpp +++ b/components/esm3/loadcell.cpp @@ -316,7 +316,7 @@ namespace ESM void Cell::blank() { mName = ""; - mRegion = ESM::RefId::sEmpty; + mRegion = ESM::RefId(); mWater = 0; mWaterInt = false; mMapColor = 0; diff --git a/components/esm3/loadclot.cpp b/components/esm3/loadclot.cpp index 8f86f55a5c..14c881c84f 100644 --- a/components/esm3/loadclot.cpp +++ b/components/esm3/loadclot.cpp @@ -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(); } } diff --git a/components/esm3/loadcont.cpp b/components/esm3/loadcont.cpp index 2d4b134350..e71352412b 100644 --- a/components/esm3/loadcont.cpp +++ b/components/esm3/loadcont.cpp @@ -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(); diff --git a/components/esm3/loadcrea.cpp b/components/esm3/loadcrea.cpp index 29d9535e47..27cc98c1f2 100644 --- a/components/esm3/loadcrea.cpp +++ b/components/esm3/loadcrea.cpp @@ -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(); diff --git a/components/esm3/loaddoor.cpp b/components/esm3/loaddoor.cpp index 07dd4cd964..6086a2ddd9 100644 --- a/components/esm3/loaddoor.cpp +++ b/components/esm3/loaddoor.cpp @@ -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(); } } diff --git a/components/esm3/loadinfo.cpp b/components/esm3/loadinfo.cpp index 16270e57e2..8807f7b03f 100644 --- a/components/esm3/loadinfo.cpp +++ b/components/esm3/loadinfo.cpp @@ -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(); diff --git a/components/esm3/loadingr.cpp b/components/esm3/loadingr.cpp index b57abe0428..fef7a93feb 100644 --- a/components/esm3/loadingr.cpp +++ b/components/esm3/loadingr.cpp @@ -102,6 +102,6 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); } } diff --git a/components/esm3/loadligh.cpp b/components/esm3/loadligh.cpp index 5e84b321c6..150baccec0 100644 --- a/components/esm3/loadligh.cpp +++ b/components/esm3/loadligh.cpp @@ -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(); diff --git a/components/esm3/loadlock.cpp b/components/esm3/loadlock.cpp index 7058860532..0e87558871 100644 --- a/components/esm3/loadlock.cpp +++ b/components/esm3/loadlock.cpp @@ -81,6 +81,6 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); } } diff --git a/components/esm3/loadltex.cpp b/components/esm3/loadltex.cpp index f9ce3a72b2..d015123559 100644 --- a/components/esm3/loadltex.cpp +++ b/components/esm3/loadltex.cpp @@ -57,7 +57,7 @@ namespace ESM void LandTexture::blank() { - mId = ESM::RefId::sEmpty; + mId = ESM::RefId(); mTexture.clear(); } } diff --git a/components/esm3/loadmgef.cpp b/components/esm3/loadmgef.cpp index 019c7db616..69abbd5903 100644 --- a/components/esm3/loadmgef.cpp +++ b/components/esm3/loadmgef.cpp @@ -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(); } diff --git a/components/esm3/loadmisc.cpp b/components/esm3/loadmisc.cpp index 77863d90fa..780e8077fe 100644 --- a/components/esm3/loadmisc.cpp +++ b/components/esm3/loadmisc.cpp @@ -79,6 +79,6 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); } } diff --git a/components/esm3/loadnpc.cpp b/components/esm3/loadnpc.cpp index 7f68ac1788..2425341b1f 100644 --- a/components/esm3/loadnpc.cpp +++ b/components/esm3/loadnpc.cpp @@ -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() diff --git a/components/esm3/loadpgrd.cpp b/components/esm3/loadpgrd.cpp index 912d21f77e..c2a94e6e65 100644 --- a/components/esm3/loadpgrd.cpp +++ b/components/esm3/loadpgrd.cpp @@ -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; diff --git a/components/esm3/loadprob.cpp b/components/esm3/loadprob.cpp index a45c91cb35..779f0d1534 100644 --- a/components/esm3/loadprob.cpp +++ b/components/esm3/loadprob.cpp @@ -81,6 +81,6 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); } } diff --git a/components/esm3/loadregn.cpp b/components/esm3/loadregn.cpp index b4a362dbef..31384e680d 100644 --- a/components/esm3/loadregn.cpp +++ b/components/esm3/loadregn.cpp @@ -110,7 +110,7 @@ namespace ESM mMapColor = 0; mName.clear(); - mSleepList = ESM::RefId::sEmpty; + mSleepList = ESM::RefId(); mSoundList.clear(); } } diff --git a/components/esm3/loadrepa.cpp b/components/esm3/loadrepa.cpp index 7e48e9854c..ea0fc29f19 100644 --- a/components/esm3/loadrepa.cpp +++ b/components/esm3/loadrepa.cpp @@ -81,6 +81,6 @@ namespace ESM mName.clear(); mModel.clear(); mIcon.clear(); - mScript = ESM::RefId::sEmpty; + mScript = ESM::RefId(); } } diff --git a/components/esm3/loadsndg.cpp b/components/esm3/loadsndg.cpp index 2763180ad0..3e5d8f373e 100644 --- a/components/esm3/loadsndg.cpp +++ b/components/esm3/loadsndg.cpp @@ -66,7 +66,7 @@ namespace ESM { mRecordFlags = 0; mType = LeftFoot; - mCreature = ESM::RefId::sEmpty; - mSound = ESM::RefId::sEmpty; + mCreature = ESM::RefId(); + mSound = ESM::RefId(); } } diff --git a/components/esm3/loadweap.cpp b/components/esm3/loadweap.cpp index 22fe3816fa..501f0602e4 100644 --- a/components/esm3/loadweap.cpp +++ b/components/esm3/loadweap.cpp @@ -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(); } }