mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 04:10:24 +00:00
Remove getRefIdRef
because it is the same as getRefId
.
This commit is contained in:
parent
c263bbf0f6
commit
203ee492c8
7 changed files with 14 additions and 17 deletions
|
@ -95,7 +95,7 @@ namespace MWLua
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string& recordId = std::get<std::string>(item);
|
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
|
return true; // already equipped
|
||||||
itemPtr = store.search(recordId);
|
itemPtr = store.search(recordId);
|
||||||
if (itemPtr.isEmpty() || itemPtr.getRefData().getCount() == 0)
|
if (itemPtr.isEmpty() || itemPtr.getRefData().getCount() == 0)
|
||||||
|
|
|
@ -374,7 +374,7 @@ namespace MWLua
|
||||||
std::shared_ptr<LocalScripts> scripts;
|
std::shared_ptr<LocalScripts> scripts;
|
||||||
if (flag == ESM::LuaScriptCfg::sPlayer)
|
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 = std::make_shared<PlayerScripts>(&mLua, LObject(getId(ptr), mWorldView.getObjectRegistry()));
|
||||||
scripts->addPackage("openmw.ui", mUserInterfacePackage);
|
scripts->addPackage("openmw.ui", mUserInterfacePackage);
|
||||||
scripts->addPackage("openmw.camera", mCameraPackage);
|
scripts->addPackage("openmw.camera", mCameraPackage);
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace MWLua
|
||||||
|
|
||||||
bool isMarker(const MWWorld::Ptr& ptr)
|
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";
|
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
|
// 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
|
// 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).
|
// is not necessary because they are not listed in OpenMW Lua documentation).
|
||||||
if (ptr.getCellRef().getRefIdRef() == "player")
|
if (ptr.getCellRef().getRefId() == "player")
|
||||||
return "Player";
|
return "Player";
|
||||||
if (isMarker(ptr))
|
if (isMarker(ptr))
|
||||||
return "Marker";
|
return "Marker";
|
||||||
|
@ -64,7 +64,7 @@ namespace MWLua
|
||||||
|
|
||||||
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr)
|
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
if (ptr.getCellRef().getRefIdRef() == "player")
|
if (ptr.getCellRef().getRefId() == "player")
|
||||||
return ESM::LuaScriptCfg::sPlayer;
|
return ESM::LuaScriptCfg::sPlayer;
|
||||||
if (isMarker(ptr))
|
if (isMarker(ptr))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -82,7 +82,7 @@ namespace MWLua
|
||||||
res.append(" (");
|
res.append(" (");
|
||||||
res.append(getLuaObjectTypeName(ptr));
|
res.append(getLuaObjectTypeName(ptr));
|
||||||
res.append(", ");
|
res.append(", ");
|
||||||
res.append(ptr.getCellRef().getRefIdRef());
|
res.append(ptr.getCellRef().getRefId());
|
||||||
res.append(")");
|
res.append(")");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,6 @@ namespace MWWorld
|
||||||
// Id of object being referenced
|
// Id of object being referenced
|
||||||
const std::string& getRefId() const { return mCellRef.mRefID; }
|
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
|
// For doors - true if this door teleports to somewhere else, false
|
||||||
// if it should open through animation.
|
// if it should open through animation.
|
||||||
bool getTeleport() const { return mCellRef.mTeleport; }
|
bool getTeleport() const { return mCellRef.mTeleport; }
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace
|
||||||
}
|
}
|
||||||
bool cont = cell.second.forEach([&] (MWWorld::Ptr ptr)
|
bool cont = cell.second.forEach([&] (MWWorld::Ptr ptr)
|
||||||
{
|
{
|
||||||
if (ptr.getCellRef().getRefIdRef() == id)
|
if (ptr.getCellRef().getRefId() == id)
|
||||||
{
|
{
|
||||||
return visitor(ptr);
|
return visitor(ptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace
|
||||||
{
|
{
|
||||||
for (typename MWWorld::CellRefList<T>::List::iterator iter (collection.mList.begin());
|
for (typename MWWorld::CellRefList<T>::List::iterator iter (collection.mList.begin());
|
||||||
iter!=collection.mList.end(); ++iter)
|
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
|
// overwrite existing reference
|
||||||
float oldscale = iter->mRef.getScale();
|
float oldscale = iter->mRef.getScale();
|
||||||
|
@ -426,7 +426,7 @@ namespace MWWorld
|
||||||
const std::string *mIdToFind;
|
const std::string *mIdToFind;
|
||||||
bool operator()(const PtrType& ptr)
|
bool operator()(const PtrType& ptr)
|
||||||
{
|
{
|
||||||
if (ptr.getCellRef().getRefIdRef() == *mIdToFind)
|
if (ptr.getCellRef().getRefId() == *mIdToFind)
|
||||||
{
|
{
|
||||||
mFound = ptr;
|
mFound = ptr;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -183,7 +183,7 @@ int MWWorld::ContainerStore::count(const std::string &id) const
|
||||||
{
|
{
|
||||||
int total=0;
|
int total=0;
|
||||||
for (const auto&& iter : *this)
|
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();
|
total += iter.getRefData().getCount();
|
||||||
return total;
|
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& cls1 = ptr1.getClass();
|
||||||
const MWWorld::Class& cls2 = ptr2.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;
|
return false;
|
||||||
|
|
||||||
// If it has an enchantment, don't stack when some of the charge is already used
|
// 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)
|
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));
|
iter->getRefData().setCount(addItems(iter->getRefData().getCount(false), realCount));
|
||||||
flagAsModified();
|
flagAsModified();
|
||||||
|
@ -464,7 +464,7 @@ int MWWorld::ContainerStore::remove(const std::string& itemId, int count, const
|
||||||
int toRemove = count;
|
int toRemove = count;
|
||||||
|
|
||||||
for (ContainerStoreIterator iter(begin()); iter != end() && toRemove > 0; ++iter)
|
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);
|
toRemove -= remove(*iter, toRemove, actor, equipReplacement, resolveFirst);
|
||||||
|
|
||||||
flagAsModified();
|
flagAsModified();
|
||||||
|
@ -739,7 +739,7 @@ MWWorld::Ptr MWWorld::ContainerStore::findReplacement(const std::string& id)
|
||||||
for (auto&& iter : *this)
|
for (auto&& iter : *this)
|
||||||
{
|
{
|
||||||
int iterHealth = iter.getClass().hasItemHealth(iter) ? iter.getClass().getItemHealth(iter) : 1;
|
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
|
// Prefer the stack with the lowest remaining uses
|
||||||
// Try to get item with zero durability only if there are no other items found
|
// Try to get item with zero durability only if there are no other items found
|
||||||
|
|
Loading…
Reference in a new issue