From 5a5cb1a160d65b9b1d84a65bece4a7626daab3ec Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sun, 17 Sep 2017 14:09:29 +0100 Subject: [PATCH] Check death counts are for valid actors before loading them --- apps/openmw/mwmechanics/actors.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index baa2470da..673304d30 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1767,9 +1767,12 @@ namespace MWMechanics while (reader.isNextSub("ID__")) { std::string id = reader.getHString(); - int count; - reader.getHNT (count, "COUN"); - mDeathCount[id] = count; + if (MWBase::Environment::get().getWorld()->getStore().find(id)) + { + int count; + reader.getHNT(count, "COUN"); + mDeathCount[id] = count; + } } } }