mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-04 21:19:41 +00:00
Add searchByRefNum method to OpenMW's CellStore
This commit is contained in:
parent
92463c4a03
commit
cc98a25dcf
3 changed files with 17 additions and 2 deletions
|
@ -654,9 +654,13 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
|
||||||
event->cellRef.mRefID.c_str(),
|
event->cellRef.mRefID.c_str(),
|
||||||
event->cellRef.mRefNum);
|
event->cellRef.mRefNum);
|
||||||
|
|
||||||
//MWWorld::Ptr object = ptrCellStore->search(event->cellRef.mRefID);
|
MWWorld::Ptr ptrFound = ptrCellStore->searchByRefNum(event->cellRef.mRefNum);
|
||||||
//MWBase::Environment::get().getWorld()->deleteObject(object);
|
|
||||||
|
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Found %s, %i",
|
||||||
|
ptrFound.getCellRef().getRefId().c_str(),
|
||||||
|
ptrFound.getCellRef().getRefNum());
|
||||||
|
|
||||||
|
//MWBase::Environment::get().getWorld()->deleteObject(object);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,6 +433,14 @@ namespace MWWorld
|
||||||
return Ptr();
|
return Ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added by tes3mp
|
||||||
|
Ptr CellStore::searchByRefNum (ESM::RefNum refNum)
|
||||||
|
{
|
||||||
|
SearchByRefNumVisitor searchVisitor(refNum);
|
||||||
|
forEach(searchVisitor);
|
||||||
|
return searchVisitor.mFound;
|
||||||
|
}
|
||||||
|
|
||||||
float CellStore::getWaterLevel() const
|
float CellStore::getWaterLevel() const
|
||||||
{
|
{
|
||||||
if (isExterior())
|
if (isExterior())
|
||||||
|
|
|
@ -228,6 +228,9 @@ namespace MWWorld
|
||||||
Ptr searchViaActorId (int id);
|
Ptr searchViaActorId (int id);
|
||||||
///< Will return an empty Ptr if cell is not loaded.
|
///< Will return an empty Ptr if cell is not loaded.
|
||||||
|
|
||||||
|
Ptr searchByRefNum (ESM::RefNum refNum);
|
||||||
|
///< Added by tes3mp
|
||||||
|
|
||||||
float getWaterLevel() const;
|
float getWaterLevel() const;
|
||||||
|
|
||||||
void setWaterLevel (float level);
|
void setWaterLevel (float level);
|
||||||
|
|
Loading…
Reference in a new issue