1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 08:15:37 +00:00

Fix slow AiPackage::getTarget calls

Assume there are no cell refs with empty ref id.
This commit is contained in:
elsid 2021-07-04 03:15:40 +02:00
parent e582d5ecaa
commit 8d1eb7e2e6
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 6 additions and 0 deletions

View file

@ -143,6 +143,7 @@
Bug #6036: OpenMW-CS: Terrain selection at the border of cells omits certain corner vertices
Bug #6043: Actor can have torch missing when torch animation is played
Bug #6047: Mouse bindings can be triggered during save loading
Bug #6136: Game freezes when NPCs try to open doors that are about to be closed
Feature #390: 3rd person look "over the shoulder"
Feature #832: OpenMW-CS: Handle deleted references
Feature #1536: Show more information about level on menu

View file

@ -55,6 +55,11 @@ MWWorld::Ptr MWMechanics::AiPackage::getTarget() const
if (mTargetActorId == -1)
{
if (mTargetActorRefId.empty())
{
mTargetActorId = -2;
return MWWorld::Ptr();
}
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->searchPtr(mTargetActorRefId, false);
if (target.isEmpty())
{