mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-03 14:51:37 +00:00
[Client] Don't initialize disabled or deleted actors as LocalActors
This commit is contained in:
parent
980edac942
commit
f43ba7fba2
2 changed files with 12 additions and 0 deletions
|
@ -462,6 +462,9 @@ void Cell::initializeLocalActors()
|
|||
// If this Ptr is lacking a unique index, ignore it
|
||||
if (ptr.getCellRef().getRefNum().mIndex == 0 && ptr.getCellRef().getMpNum() == 0) continue;
|
||||
|
||||
// If this Ptr is disabled or deleted, ignore it
|
||||
if (!ptr.getRefData().isEnabled() || ptr.getRefData().isDeleted()) continue;
|
||||
|
||||
std::string mapIndex = Main::get().getCellController()->generateMapIndex(ptr);
|
||||
|
||||
// Only initialize this actor if it isn't already initialized
|
||||
|
|
|
@ -620,7 +620,16 @@ void ObjectList::setObjectStates(MWWorld::CellStore* cellStore)
|
|||
ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum());
|
||||
|
||||
if (baseObject.objectState)
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->enable(ptrFound);
|
||||
|
||||
// Is this an actor in a cell where we're the authority? If so, initialize it as
|
||||
// a LocalActor
|
||||
if (ptrFound.getClass().isActor() && mwmp::Main::get().getCellController()->hasLocalAuthority(*cellStore->getCell()))
|
||||
{
|
||||
mwmp::Main::get().getCellController()->getCell(*cellStore->getCell())->initializeLocalActor(ptrFound);
|
||||
}
|
||||
}
|
||||
else
|
||||
MWBase::Environment::get().getWorld()->disable(ptrFound);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue