[Client] Stop creating new reference numbers for placed/spawned objects

0.6.1
David Cernat 8 years ago
parent d8712ee1ea
commit e5cf632e1d

@ -58,14 +58,6 @@ namespace MWGui
if (setNewOwner)
dropped.getCellRef().setOwner("");
// Major change done by tes3mp:
// When the object is dropped, generate a new RefNum index for it that follows the last one
// in the cell, so that packets can be sent and received specifically about it, instead
// of giving it a RefNum index of 0 as in regular OpenMW
MWWorld::CellStore *cellStore = dropped.getCell();
cellStore->setLastRefNumIndex(cellStore->getLastRefNumIndex() + 1);
dropped.getCellRef().setRefNumIndex(cellStore->getLastRefNumIndex());
/*
Start of tes3mp addition

@ -176,14 +176,6 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore)
newPtr.getCellRef().setGoldValue(worldObject.goldValue);
newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, cellStore, worldObject.pos);
// Change RefNum here because the line above unsets it
newPtr.getCellRef().setRefNumIndex(worldObject.refNumIndex);
// If this RefNum is higher than the last we've recorded for this CellStore,
// start using it as our new last one
if (cellStore->getLastRefNumIndex() < worldObject.refNumIndex)
cellStore->setLastRefNumIndex(worldObject.refNumIndex);
}
}

@ -550,14 +550,6 @@ namespace MWScript
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(), actor, actor.getCell(), direction, distance);
// Major change done by tes3mp:
// When the object is dropped, generate a new RefNum index for it that follows the last one
// in the cell, so that packets can be sent and received specifically about it, instead
// of giving it a RefNum index of 0 as in regular OpenMW
MWWorld::CellStore *cellStore = ptr.getCell();
cellStore->setLastRefNumIndex(cellStore->getLastRefNumIndex() + 1);
ptr.getCellRef().setRefNumIndex(cellStore->getLastRefNumIndex());
/*
Start of tes3mp addition

@ -20,13 +20,6 @@ namespace MWWorld
mCellRef.mRefNum.unset();
}
// Added by tes3mp to allow creation of new items with RefNum indexes
// specific to them
void CellRef::setRefNumIndex(int index)
{
mCellRef.mRefNum.mIndex = index;
}
std::string CellRef::getRefId() const
{
return mCellRef.mRefID;

@ -28,10 +28,6 @@ namespace MWWorld
// Set RefNum to its default state.
void unsetRefNum();
// Added by tes3mp to allow creation of new items with RefNum indexes
// specific to them
void setRefNumIndex(int index);
/// Does the RefNum have a content file?
bool hasContentFile() const;

@ -479,18 +479,6 @@ namespace MWWorld
return searchVisitor.mFound;
}
// Added by tes3mp and used to get the last reference number in the cell
unsigned int CellStore::getLastRefNumIndex() const
{
return lastRefNumIndex;
}
// Added by tes3mp and used to record the last reference number in the cell
void CellStore::setLastRefNumIndex(unsigned int value)
{
lastRefNumIndex = value;
}
// Added by tes3mp and used to get all the containers in the cell
CellRefList<ESM::Container> *CellStore::getContainers()
{
@ -650,9 +638,6 @@ namespace MWWorld
loadRef (ref, deleted, refNumToID);
}
if(refNumToID.size() != 0)
setLastRefNumIndex(refNumToID.rbegin()->first.mIndex);
updateMergedRefs();
}

@ -237,12 +237,6 @@ namespace MWWorld
Ptr searchExact (const std::string& id, unsigned int numIndex);
///< Added by tes3mp and used to find an object by both its ID and its reference number
unsigned int getLastRefNumIndex() const;
// Added by tes3mp and used to get the last reference number in the cell
void setLastRefNumIndex(unsigned int value);
// Added by tes3mp and used to record the last reference number in the cell
CellRefList<ESM::Container> *getContainers();
// Added by tes3mp and used to get all the containers in the cell

Loading…
Cancel
Save