mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
[Client] Don't initialize disabled or deleted actors as LocalActors
This commit is contained in:
parent
980edac942
commit
f43ba7fba2
@ -462,6 +462,9 @@ void Cell::initializeLocalActors()
|
|||||||
// If this Ptr is lacking a unique index, ignore it
|
// If this Ptr is lacking a unique index, ignore it
|
||||||
if (ptr.getCellRef().getRefNum().mIndex == 0 && ptr.getCellRef().getMpNum() == 0) continue;
|
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);
|
std::string mapIndex = Main::get().getCellController()->generateMapIndex(ptr);
|
||||||
|
|
||||||
// Only initialize this actor if it isn't already initialized
|
// 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());
|
ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum());
|
||||||
|
|
||||||
if (baseObject.objectState)
|
if (baseObject.objectState)
|
||||||
|
{
|
||||||
MWBase::Environment::get().getWorld()->enable(ptrFound);
|
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
|
else
|
||||||
MWBase::Environment::get().getWorld()->disable(ptrFound);
|
MWBase::Environment::get().getWorld()->disable(ptrFound);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user