Corpse clearing fix

move
scrawl 9 years ago
parent 87871d7d54
commit 2821f46a18

@ -22,7 +22,7 @@ namespace MWMechanics
mKnockdown(false), mKnockdownOneFrame(false), mKnockdownOverOneFrame(false),
mHitRecovery(false), mBlock(false), mMovementFlags(0),
mFallHeight(0), mRecalcMagicka(false), mLastRestock(0,0), mGoldPool(0), mActorId(-1),
mDeathAnimation(0), mLevel (0)
mDeathAnimation(0), mTimeOfDeath(), mLevel (0)
{
for (int i=0; i<4; ++i)
mAiSettings[i] = 0;

@ -893,7 +893,7 @@ namespace MWWorld
{
const MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
static const float fCorpseClearDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCorpseClearDelay")->getFloat();
if (!ptr.getClass().isPersistent(ptr) && creatureStats.getTimeOfDeath() + fCorpseClearDelay <= MWBase::Environment::get().getWorld()->getTimeStamp())
if (creatureStats.isDead() && !ptr.getClass().isPersistent(ptr) && creatureStats.getTimeOfDeath() + fCorpseClearDelay <= MWBase::Environment::get().getWorld()->getTimeStamp())
MWBase::Environment::get().getWorld()->deleteObject(ptr);
}

@ -87,6 +87,8 @@ void ESM::CreatureStats::load (ESMReader &esm)
mDeathAnimation = 0;
esm.getHNOT (mDeathAnimation, "DANM");
mTimeOfDeath.mDay = 0;
mTimeOfDeath.mHour = 0;
esm.getHNOT (mTimeOfDeath, "DTIM");
mSpells.load(esm);

Loading…
Cancel
Save