From 6de7e165504981fef276a93ea6c7980b3d53ec82 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 15 May 2014 06:08:55 +0200 Subject: [PATCH] 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. --- apps/openmw/mwworld/cellstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index a5f1663744..5d2d8a5175 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -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; }