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.
deque
scrawl 11 years ago
parent b6a7aee42e
commit 6de7e16550

@ -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;
}

Loading…
Cancel
Save