Check death counts are for valid actors before loading them

experimental
AnyOldName3 7 years ago
parent f24b807edc
commit 5a5cb1a160

@ -1767,9 +1767,12 @@ namespace MWMechanics
while (reader.isNextSub("ID__")) while (reader.isNextSub("ID__"))
{ {
std::string id = reader.getHString(); std::string id = reader.getHString();
int count; if (MWBase::Environment::get().getWorld()->getStore().find(id))
reader.getHNT (count, "COUN"); {
mDeathCount[id] = count; int count;
reader.getHNT(count, "COUN");
mDeathCount[id] = count;
}
} }
} }
} }

Loading…
Cancel
Save