Merge branch 'refidref' into 'master'

Remove `getRefIdRef` because it is the same as `getRefId`.

See merge request OpenMW/openmw!1585
ptmikheev-master-patch-38354
jvoisin 3 years ago
commit 4ae1ea1ee3

@ -95,7 +95,7 @@ namespace MWLua
else
{
const std::string& recordId = std::get<std::string>(item);
if (old_it != store.end() && old_it->getCellRef().getRefIdRef() == recordId)
if (old_it != store.end() && old_it->getCellRef().getRefId() == recordId)
return true; // already equipped
itemPtr = store.search(recordId);
if (itemPtr.isEmpty() || itemPtr.getRefData().getCount() == 0)

@ -380,7 +380,7 @@ namespace MWLua
std::shared_ptr<LocalScripts> scripts;
if (flag == ESM::LuaScriptCfg::sPlayer)
{
assert(ptr.getCellRef().getRefIdRef() == "player");
assert(ptr.getCellRef().getRefId() == "player");
scripts = std::make_shared<PlayerScripts>(&mLua, LObject(getId(ptr), mWorldView.getObjectRegistry()));
scripts->addPackage("openmw.ui", mUserInterfacePackage);
scripts->addPackage("openmw.camera", mCameraPackage);

@ -44,7 +44,7 @@ namespace MWLua
bool isMarker(const MWWorld::Ptr& ptr)
{
std::string_view id = ptr.getCellRef().getRefIdRef();
std::string_view id = ptr.getCellRef().getRefId();
return id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker";
}
@ -55,7 +55,7 @@ namespace MWLua
// and can be accidentally changed. We use `ptr.getTypeDescription()` only as a fallback
// for types that are not present in `luaObjectTypeInfo` (for such types result stability
// is not necessary because they are not listed in OpenMW Lua documentation).
if (ptr.getCellRef().getRefIdRef() == "player")
if (ptr.getCellRef().getRefId() == "player")
return "Player";
if (isMarker(ptr))
return "Marker";
@ -64,7 +64,7 @@ namespace MWLua
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr)
{
if (ptr.getCellRef().getRefIdRef() == "player")
if (ptr.getCellRef().getRefId() == "player")
return ESM::LuaScriptCfg::sPlayer;
if (isMarker(ptr))
return 0;
@ -82,7 +82,7 @@ namespace MWLua
res.append(" (");
res.append(getLuaObjectTypeName(ptr));
res.append(", ");
res.append(ptr.getCellRef().getRefIdRef());
res.append(ptr.getCellRef().getRefId());
res.append(")");
return res;
}

@ -38,9 +38,6 @@ namespace MWWorld
// Id of object being referenced
const std::string& getRefId() const { return mCellRef.mRefID; }
// Reference to ID of the object being referenced
const std::string& getRefIdRef() const { return mCellRef.mRefID; } // TODO replace with getRefId
// For doors - true if this door teleports to somewhere else, false
// if it should open through animation.
bool getTeleport() const { return mCellRef.mTeleport; }

@ -36,7 +36,7 @@ namespace
}
bool cont = cell.second.forEach([&] (MWWorld::Ptr ptr)
{
if (ptr.getCellRef().getRefIdRef() == id)
if (ptr.getCellRef().getRefId() == id)
{
return visitor(ptr);
}

@ -190,7 +190,7 @@ namespace
{
for (typename MWWorld::CellRefList<T>::List::iterator iter (collection.mList.begin());
iter!=collection.mList.end(); ++iter)
if (iter->mRef.getRefNum()==state.mRef.mRefNum && iter->mRef.getRefIdRef() == state.mRef.mRefID)
if (iter->mRef.getRefNum()==state.mRef.mRefNum && iter->mRef.getRefId() == state.mRef.mRefID)
{
// overwrite existing reference
float oldscale = iter->mRef.getScale();
@ -426,7 +426,7 @@ namespace MWWorld
const std::string *mIdToFind;
bool operator()(const PtrType& ptr)
{
if (ptr.getCellRef().getRefIdRef() == *mIdToFind)
if (ptr.getCellRef().getRefId() == *mIdToFind)
{
mFound = ptr;
return false;

@ -183,7 +183,7 @@ int MWWorld::ContainerStore::count(const std::string &id) const
{
int total=0;
for (const auto&& iter : *this)
if (Misc::StringUtils::ciEqual(iter.getCellRef().getRefIdRef(), id))
if (Misc::StringUtils::ciEqual(iter.getCellRef().getRefId(), id))
total += iter.getRefData().getCount();
return total;
}
@ -248,7 +248,7 @@ bool MWWorld::ContainerStore::stacks(const ConstPtr& ptr1, const ConstPtr& ptr2)
const MWWorld::Class& cls1 = ptr1.getClass();
const MWWorld::Class& cls2 = ptr2.getClass();
if (!Misc::StringUtils::ciEqual(ptr1.getCellRef().getRefIdRef(), ptr2.getCellRef().getRefIdRef()))
if (!Misc::StringUtils::ciEqual(ptr1.getCellRef().getRefId(), ptr2.getCellRef().getRefId()))
return false;
// If it has an enchantment, don't stack when some of the charge is already used
@ -363,7 +363,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr,
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
{
if (Misc::StringUtils::ciEqual(iter->getCellRef().getRefIdRef(), MWWorld::ContainerStore::sGoldId))
if (Misc::StringUtils::ciEqual(iter->getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
{
iter->getRefData().setCount(addItems(iter->getRefData().getCount(false), realCount));
flagAsModified();
@ -464,7 +464,7 @@ int MWWorld::ContainerStore::remove(const std::string& itemId, int count, const
int toRemove = count;
for (ContainerStoreIterator iter(begin()); iter != end() && toRemove > 0; ++iter)
if (Misc::StringUtils::ciEqual(iter->getCellRef().getRefIdRef(), itemId))
if (Misc::StringUtils::ciEqual(iter->getCellRef().getRefId(), itemId))
toRemove -= remove(*iter, toRemove, actor, equipReplacement, resolveFirst);
flagAsModified();
@ -739,7 +739,7 @@ MWWorld::Ptr MWWorld::ContainerStore::findReplacement(const std::string& id)
for (auto&& iter : *this)
{
int iterHealth = iter.getClass().hasItemHealth(iter) ? iter.getClass().getItemHealth(iter) : 1;
if (Misc::StringUtils::ciEqual(iter.getCellRef().getRefIdRef(), id))
if (Misc::StringUtils::ciEqual(iter.getCellRef().getRefId(), id))
{
// Prefer the stack with the lowest remaining uses
// Try to get item with zero durability only if there are no other items found

Loading…
Cancel
Save