1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-25 03:40:40 +00:00

Fix searchPtrViaActorId not skipping over deleted references

Fixes an issue when an actor has moved cell: searchPtrViaActorId would randomly return the deleted Ptr from the old cell.
This commit is contained in:
scrawl 2014-05-15 06:08:55 +02:00
parent b6a7aee42e
commit 6de7e16550

View File

@ -54,7 +54,7 @@ namespace
{
MWWorld::Ptr actor (&*iter, cell);
if (MWWorld::Class::get (actor).getCreatureStats (actor).matchesActorId (actorId))
if (actor.getClass().getCreatureStats (actor).matchesActorId (actorId) && actor.getRefData().getCount() > 0)
return actor;
}