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.
pull/3229/head
elsid 2 years ago
parent 9487312fb8
commit b5ec584be2
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -190,7 +190,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
ESM::DialInfo info = record.get(); ESM::DialInfo info = record.get();
info.mId = record.get().mOriginalId; info.mId = record.get().mOriginalId;
info.mPrev = ESM::RefId::sEmpty; info.mPrev = ESM::RefId();
if (iter != infos.begin()) if (iter != infos.begin())
{ {
const auto prev = std::prev(iter); const auto prev = std::prev(iter);
@ -199,7 +199,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
const auto next = std::next(iter); const auto next = std::next(iter);
info.mNext = ESM::RefId::sEmpty; info.mNext = ESM::RefId();
if (next != infos.end()) if (next != infos.end())
info.mNext = (*next)->get().mOriginalId; info.mNext = (*next)->get().mOriginalId;

@ -92,7 +92,7 @@ int CSMTools::ScriptCheckStage::setup()
mContext.clear(); mContext.clear();
mMessages = nullptr; mMessages = nullptr;
mId = ESM::RefId::sEmpty; mId = ESM::RefId();
Compiler::ErrorHandler::reset(); Compiler::ErrorHandler::reset();
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();

@ -94,9 +94,9 @@ namespace CSMWorld
mId = id; mId = id;
mIsBeast = isBeast; mIsBeast = isBeast;
for (auto& str : mFemaleParts) for (auto& str : mFemaleParts)
str = ESM::RefId::sEmpty; str = ESM::RefId();
for (auto& str : mMaleParts) for (auto& str : mMaleParts)
str = ESM::RefId::sEmpty; str = ESM::RefId();
mDependencies.clear(); mDependencies.clear();
// Mark self as a dependency // Mark self as a dependency
@ -591,7 +591,7 @@ namespace CSMWorld
// An another vanilla quirk: hide hairs if an item replaces Head part // An another vanilla quirk: hide hairs if an item replaces Head part
if (partType == ESM::PRT_Head) 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; std::map<ESM::RefId, int>& reactions = faction.mReactions;
// blank row // blank row
reactions.insert(std::make_pair(ESM::RefId::sEmpty, 0)); reactions.insert(std::make_pair(ESM::RefId(), 0));
record.setModified(faction); record.setModified(faction);
} }
@ -382,7 +382,7 @@ namespace CSMWorld
// blank row // blank row
ESM::Region::SoundRef soundRef; ESM::Region::SoundRef soundRef;
soundRef.mSound = ESM::RefId::sEmpty; soundRef.mSound = ESM::RefId();
soundRef.mChance = 0; soundRef.mChance = 0;
soundList.insert(soundList.begin() + position, soundRef); 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 // Keep mOriginalCell empty when in modified (as an indicator that the
// original cell will always be equal the current cell). // 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()) 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) 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)); 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) 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; unsigned int idNum = static_cast<Record<CellRef>*>(record.get())->get().mIdNum;
Collection<CellRef, IdAccessor<CellRef>>::insertRecord(std::move(record), index, type); // add records only Collection<CellRef, IdAccessor<CellRef>>::insertRecord(std::move(record), index, type); // add records only

@ -1986,8 +1986,8 @@ namespace CSMWorld
ESM::PartReference newPart; ESM::PartReference newPart;
newPart.mPart = 0; // 0 == head newPart.mPart = 0; // 0 == head
newPart.mMale = ESM::RefId::sEmpty; newPart.mMale = ESM::RefId();
newPart.mFemale = ESM::RefId::sEmpty; newPart.mFemale = ESM::RefId();
if (position >= (int)list.size()) if (position >= (int)list.size())
list.push_back(newPart); list.push_back(newPart);
@ -2343,7 +2343,7 @@ namespace CSMWorld
std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList; std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList;
ESM::LevelledListBase::LevelItem newItem; ESM::LevelledListBase::LevelItem newItem;
newItem.mId = ESM::RefId::sEmpty; newItem.mId = ESM::RefId();
newItem.mLevel = 0; newItem.mLevel = 0;
if (position >= (int)list.size()) if (position >= (int)list.size())

@ -127,7 +127,7 @@ namespace MWBase
* @return was the crime seen? * @return was the crime seen?
*/ */
virtual bool commitCrime(const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim, OffenseType type, 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; = 0;
/// @return false if the attack was considered a "friendly hit" and forgiven /// @return false if the attack was considered a "friendly hit" and forgiven
virtual bool actorAttacked(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) = 0; 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>(); const MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>();
ESM::Armor newItem = *ref->mBase; ESM::Armor newItem = *ref->mBase;
newItem.mId = ESM::RefId::sEmpty; newItem.mId = ESM::RefId();
newItem.mName = newName; newItem.mName = newName;
newItem.mData.mEnchant = enchCharge; newItem.mData.mEnchant = enchCharge;
newItem.mEnchant = enchId; newItem.mEnchant = enchId;

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

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

@ -42,7 +42,7 @@ namespace MWClass
unsigned int seed = Misc::Rng::rollDice(std::numeric_limits<int>::max(), prng); unsigned int seed = Misc::Rng::rollDice(std::numeric_limits<int>::max(), prng);
// setting ownership not needed, since taking items from a container inherits the // setting ownership not needed, since taking items from a container inherits the
// container's owner automatically // 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) ContainerCustomData::ContainerCustomData(const ESM::InventoryState& inventory)
@ -178,7 +178,7 @@ namespace MWClass
// using a key disarms the trap // using a key disarms the trap
if (isTrapped) if (isTrapped)
{ {
ptr.getCellRef().setTrap(ESM::RefId::sEmpty); ptr.getCellRef().setTrap(ESM::RefId());
MWBase::Environment::get().getSoundManager()->playSound3D( MWBase::Environment::get().getSoundManager()->playSound3D(
ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f); ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f);
isTrapped = false; isTrapped = false;
@ -257,7 +257,7 @@ namespace MWClass
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(lockLevel); text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(lockLevel);
else if (lockLevel < 0) else if (lockLevel < 0)
text += "\n#{sUnlocked}"; text += "\n#{sUnlocked}";
if (ptr.getCellRef().getTrap() != ESM::RefId::sEmpty) if (ptr.getCellRef().getTrap() != ESM::RefId())
text += "\n#{sTrapped}"; text += "\n#{sTrapped}";
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) if (MWBase::Environment::get().getWindowManager()->getFullHelp())

@ -166,7 +166,7 @@ namespace MWClass
// using a key disarms the trap // using a key disarms the trap
if (isTrapped) if (isTrapped)
{ {
ptr.getCellRef().setTrap(ESM::RefId::sEmpty); ptr.getCellRef().setTrap(ESM::RefId());
MWBase::Environment::get().getSoundManager()->playSound3D( MWBase::Environment::get().getSoundManager()->playSound3D(
ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f); ptr, ESM::RefId::stringRefId("Disarm Trap"), 1.0f, 1.0f);
isTrapped = false; isTrapped = false;

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

@ -139,7 +139,7 @@ namespace MWDialogue
if (actor.getClass().getCreatureStats(actor).isDead()) if (actor.getClass().getCreatureStats(actor).isDead())
return false; return false;
mLastTopic = ESM::RefId::sEmpty; mLastTopic = ESM::RefId();
// Note that we intentionally don't reset mPermanentDispositionChange // Note that we intentionally don't reset mPermanentDispositionChange
mChoice = -1; mChoice = -1;

@ -19,7 +19,7 @@ namespace MWDialogue
Topic& getTopic(const ESM::RefId& id); 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: public:
Journal(); Journal();

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

@ -54,7 +54,7 @@ namespace MWGui
dropped = world->placeObject(item.mBase, mLeft, mTop, count); dropped = world->placeObject(item.mBase, mLeft, mTop, count);
else else
dropped = world->dropObjectOnGround(world->getPlayerPtr(), item.mBase, count); dropped = world->dropObjectOnGround(world->getPlayerPtr(), item.mBase, count);
dropped.getCellRef().setOwner(ESM::RefId::sEmpty); dropped.getCellRef().setOwner(ESM::RefId());
return dropped; return dropped;
} }

@ -100,7 +100,7 @@ namespace MWGui
if (pickpocket.finish()) if (pickpocket.finish())
{ {
MWBase::Environment::get().getMechanicsManager()->commitCrime( 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); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
mPickpocketDetected = true; mPickpocketDetected = true;
} }
@ -128,7 +128,7 @@ namespace MWGui
if (pickpocket.pick(item, count)) if (pickpocket.pick(item, count))
{ {
MWBase::Environment::get().getMechanicsManager()->commitCrime( 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); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
mPickpocketDetected = true; mPickpocketDetected = true;
return false; return false;

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

@ -55,19 +55,11 @@ namespace MWGui
private: private:
struct keyData struct keyData
{ {
int index; int index = -1;
ItemWidget* button; ItemWidget* button = nullptr;
QuickKeysMenu::QuickKeyType type; QuickKeysMenu::QuickKeyType type = Type_Unassigned;
ESM::RefId id; ESM::RefId id;
std::string name; std::string name;
keyData()
: index(-1)
, button(nullptr)
, type(Type_Unassigned)
, id(ESM::RefId::sEmpty)
, name("")
{
}
}; };
std::vector<keyData> mKey; std::vector<keyData> mKey;

@ -267,7 +267,7 @@ namespace MWGui
if ((mFilter & Filter_OnlyEnchanted) && !(item.mFlags & ItemStack::Flag_Enchanted)) if ((mFilter & Filter_OnlyEnchanted) && !(item.mFlags & ItemStack::Flag_Enchanted))
return false; return false;
if ((mFilter & Filter_OnlyChargedSoulstones) 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( || !MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(
base.getCellRef().getSoul()))) base.getCellRef().getSoul())))
return false; return false;

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

@ -73,7 +73,7 @@ namespace MWMechanics
void ActionEnchantedItem::prepare(const MWWorld::Ptr& actor) 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().getInventoryStore(actor).setSelectedEnchantItem(mItem);
actor.getClass().getCreatureStats(actor).setDrawState(DrawState::Spell); actor.getClass().getCreatureStats(actor).setDrawState(DrawState::Spell);
} }

@ -49,7 +49,6 @@ MWMechanics::AiPackage::AiPackage(AiPackageTypeId typeId, const Options& options
: mTypeId(typeId) : mTypeId(typeId)
, mOptions(options) , mOptions(options)
, mReaction(MWBase::Environment::get().getWorld()->getPrng()) , mReaction(MWBase::Environment::get().getWorld()->getPrng())
, mTargetActorRefId(ESM::RefId::sEmpty)
, mTargetActorId(-1) , mTargetActorId(-1)
, mCachedTarget() , mCachedTarget()
, mRotateOnTheRunChecks(0) , mRotateOnTheRunChecks(0)

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

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

@ -300,7 +300,7 @@ namespace MWMechanics
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
if (soulEmpty()) if (soulEmpty())
return 0; return 0;
if (mSoulGemPtr.getCellRef().getSoul() == ESM::RefId::sEmpty) if (mSoulGemPtr.getCellRef().getSoul().empty())
return 0; return 0;
const ESM::Creature* soul = store.get<ESM::Creature>().search(mSoulGemPtr.getCellRef().getSoul()); const ESM::Creature* soul = store.get<ESM::Creature>().search(mSoulGemPtr.getCellRef().getSoul());
if (soul) if (soul)

@ -1188,7 +1188,7 @@ namespace MWMechanics
bool reported = false; bool reported = false;
if (victim.getClass().isClass(victim, "guard") if (victim.getClass().isClass(victim, "guard")
&& !victim.getClass().getCreatureStats(victim).getAiSequence().hasPackage(AiPackageTypeId::Pursue)) && !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) if (!reported)
startCombat(victim, startCombat(victim,

@ -112,7 +112,7 @@ namespace MWMechanics
* @return was the crime seen? * @return was the crime seen?
*/ */
bool commitCrime(const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim, OffenseType type, 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 /// @return false if the attack was considered a "friendly hit" and forgiven
bool actorAttacked(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) override; bool actorAttacked(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) override;

@ -112,7 +112,7 @@ namespace MWMechanics
auto& prng = MWBase::Environment::get().getWorld()->getPrng(); auto& prng = MWBase::Environment::get().getWorld()->getPrng();
if (Misc::Rng::roll0to99(prng) <= x) if (Misc::Rng::roll0to99(prng) <= x)
{ {
trap.getCellRef().setTrap(ESM::RefId::sEmpty); trap.getCellRef().setTrap(ESM::RefId());
resultSound = "Disarm Trap"; resultSound = "Disarm Trap";
resultMessage = "#{sTrapSuccess}"; resultMessage = "#{sTrapSuccess}";

@ -83,7 +83,7 @@ namespace MWMechanics
mSpellList->remove(spell); mSpellList->remove(spell);
if (spellId == mSelectedSpell) if (spellId == mSelectedSpell)
mSelectedSpell = ESM::RefId::sEmpty; mSelectedSpell = ESM::RefId();
} }
void Spells::removeSpell(const ESM::Spell* spell) 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 /// 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. /// of a non-local script the reference derived from the target ID.
const MWWorld::Ptr getReferenceImp( 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; 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 ///< \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); int removed = store.remove(*iter, amount);
MWWorld::Ptr dropped MWWorld::Ptr dropped
= MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, removed); = MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, removed);
dropped.getCellRef().setOwner(ESM::RefId::sEmpty); dropped.getCellRef().setOwner(ESM::RefId());
amount -= removed; amount -= removed;

@ -31,6 +31,6 @@ namespace MWWorld
cast.mHitPosition = actorPosition; cast.mHitPosition = actorPosition;
cast.cast(mSpellId); 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) , mGridPos(cell.mX, cell.mY)
, mDisplayname(cell.mFullName) , mDisplayname(cell.mFullName)
, mNameID(cell.mEditorId) , mNameID(cell.mEditorId)
, mRegion(ESM::RefId::sEmpty) // Unimplemented for now , mRegion(ESM::RefId()) // Unimplemented for now
, mCellId{ , mCellId{
.mWorldspace{ Misc::StringUtils::lowerCase(cell.mEditorId) }, .mWorldspace{ Misc::StringUtils::lowerCase(cell.mEditorId) },
.mIndex{ cell.getGridX(), cell.getGridY() }, .mIndex{ cell.getGridX(), cell.getGridY() },

@ -320,9 +320,9 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add(
item.getCellRef().setPosition(pos); item.getCellRef().setPosition(pos);
// We do not need to store owners for items in container stores - we do not use it anyway. // 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().resetGlobalVariable();
item.getCellRef().setFaction(ESM::RefId::sEmpty); item.getCellRef().setFaction(ESM::RefId());
item.getCellRef().setFactionRank(-2); item.getCellRef().setFactionRank(-2);
// must reset the RefNum on the copied item, so that the RefNum on the original item stays unique // 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) for (const auto&& ptr : *this)
ptr.getRefData().setCount(0); ptr.getRefData().setCount(0);
Misc::Rng::Generator prng{ mSeed }; 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); addScripts(*this, mPtr.mCell);
} }
mModified = true; mModified = true;
@ -696,7 +696,7 @@ MWWorld::ResolutionHandle MWWorld::ContainerStore::resolveTemporarily()
for (const auto&& ptr : *this) for (const auto&& ptr : *this)
ptr.getRefData().setCount(0); ptr.getRefData().setCount(0);
Misc::Rng::Generator prng{ mSeed }; 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); addScripts(*this, mPtr.mCell);
} }
return { listener }; return { listener };
@ -711,7 +711,7 @@ void MWWorld::ContainerStore::unresolve()
{ {
for (const auto&& ptr : *this) for (const auto&& ptr : *this)
ptr.getRefData().setCount(0); 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); addScripts(*this, mPtr.mCell);
mResolved = false; mResolved = false;
} }

@ -110,7 +110,7 @@ namespace
{ {
Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '" Log(Debug::Verbose) << "NPC '" << npc.mId << "' (" << npc.mName << ") has nonexistent faction '"
<< npc.mFaction << "', ignoring it."; << npc.mFaction << "', ignoring it.";
npc.mFaction = ESM::RefId::sEmpty; npc.mFaction = ESM::RefId();
npc.mNpdt.mRank = 0; npc.mNpdt.mRank = 0;
changed = true; changed = true;
} }
@ -142,7 +142,7 @@ namespace
{ {
if (!item.mScript.empty() && !scripts.search(item.mScript)) 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 '" Log(Debug::Verbose) << "Item '" << id << "' (" << item.mName << ") has nonexistent script '"
<< item.mScript << "', ignoring it."; << 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())) && !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"; 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); MWBase::Environment::get().getLuaManager()->loadLocalScripts(ptr, state.mLuaScripts);

@ -251,7 +251,7 @@ namespace MWWorld
void Player::clear() void Player::clear()
{ {
mCellStore = nullptr; mCellStore = nullptr;
mSign = ESM::RefId::sEmpty; mSign = ESM::RefId();
mMarkedCell = nullptr; mMarkedCell = nullptr;
mTeleported = false; mTeleported = false;
mJumping = false; mJumping = false;

@ -92,7 +92,7 @@ namespace MWWorld
~RefData(); ~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 ///< Ignores custom data (not enough context available here to
/// perform this operations). /// perform this operations).

@ -454,7 +454,7 @@ namespace MWWorld
else else
mStatic.insert(it, std::move(land)); mStatic.insert(it, std::move(land));
return RecordId(ESM::RefId::sEmpty, isDeleted); return RecordId(ESM::RefId(), isDeleted);
} }
void Store<ESM::Land>::setUp() void Store<ESM::Land>::setUp()
{ {
@ -898,7 +898,7 @@ namespace MWWorld
mExt.erase(it); mExt.erase(it);
} }
return RecordId(ESM::RefId::sEmpty, isDeleted); return RecordId(ESM::RefId(), isDeleted);
} }
// Try to overwrite existing record // Try to overwrite existing record
@ -916,7 +916,7 @@ namespace MWWorld
ret.first->second = pathgrid; ret.first->second = pathgrid;
} }
return RecordId(ESM::RefId::sEmpty, isDeleted); return RecordId(ESM::RefId(), isDeleted);
} }
size_t Store<ESM::Pathgrid>::getSize() const 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")); = ESM::RefId::stringRefId(Fallback::Map::getString("Weather_" + name + "_Ambient_Loop_Sound_ID"));
if (mAmbientLoopSoundID == "None") if (mAmbientLoopSoundID == "None")
mAmbientLoopSoundID = ESM::RefId::sEmpty; mAmbientLoopSoundID = ESM::RefId();
} }
float Weather::transitionDelta() const float Weather::transitionDelta() const
@ -834,7 +834,7 @@ namespace MWWorld
if (mAmbientSound) if (mAmbientSound)
MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound); MWBase::Environment::get().getSoundManager()->stopSound(mAmbientSound);
mAmbientSound = nullptr; mAmbientSound = nullptr;
mPlayingSoundID = ESM::RefId::sEmpty; mPlayingSoundID = ESM::RefId();
} }
float WeatherManager::getWindSpeed() const float WeatherManager::getWindSpeed() const
@ -964,7 +964,7 @@ namespace MWWorld
{ {
stopSounds(); stopSounds();
mCurrentRegion = ESM::RefId::sEmpty; mCurrentRegion = ESM::RefId();
mTimePassed = 0.0f; mTimePassed = 0.0f;
mWeatherUpdateTime = 0.0f; mWeatherUpdateTime = 0.0f;
forceWeather(0); forceWeather(0);

@ -93,7 +93,7 @@ void MWWorld::WorldModel::clear()
mLastGeneratedRefnum = ESM::RefNum{}; mLastGeneratedRefnum = ESM::RefNum{};
mInteriors.clear(); mInteriors.clear();
mExteriors.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; mIdCacheIndex = 0;
} }
@ -157,7 +157,7 @@ MWWorld::WorldModel::WorldModel(const MWWorld::ESMStore& store, ESM::ReadersCach
, mPtrIndexUpdateCounter(0) , mPtrIndexUpdateCounter(0)
{ {
int cacheSize = std::clamp(Settings::Manager::getInt("pointers cache size", "Cells"), 40, 1000); 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) MWWorld::CellStore* MWWorld::WorldModel::getExterior(int x, int y)

@ -297,7 +297,7 @@ CUSTOM, PLAYER: useInterface.lua
TEST_F(LuaScriptsContainerTest, Interface) TEST_F(LuaScriptsContainerTest, Interface)
{ {
LuaUtil::ScriptsContainer scripts(&mLua, "Test"); 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 addIfaceId = *mCfg.findId("testInterface.lua");
int overrideIfaceId = *mCfg.findId("overrideInterface.lua"); int overrideIfaceId = *mCfg.findId("overrideInterface.lua");
int useIfaceId = *mCfg.findId("useInterface.lua"); int useIfaceId = *mCfg.findId("useInterface.lua");
@ -327,8 +327,8 @@ CUSTOM, PLAYER: useInterface.lua
LuaUtil::ScriptsContainer scripts1(&mLua, "Test"); LuaUtil::ScriptsContainer scripts1(&mLua, "Test");
LuaUtil::ScriptsContainer scripts2(&mLua, "Test"); LuaUtil::ScriptsContainer scripts2(&mLua, "Test");
LuaUtil::ScriptsContainer scripts3(&mLua, "Test"); LuaUtil::ScriptsContainer scripts3(&mLua, "Test");
scripts1.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::sEmpty, ESM::RefNum())); scripts2.setAutoStartConf(mCfg.getLocalConf(ESM::REC_NPC_, ESM::RefId(), ESM::RefNum()));
scripts3.setAutoStartConf(mCfg.getPlayerConf()); scripts3.setAutoStartConf(mCfg.getPlayerConf());
scripts1.addAutoStartedScripts(); scripts1.addAutoStartedScripts();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save