mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Corpse clearing fix
This commit is contained in:
parent
87871d7d54
commit
2821f46a18
3 changed files with 4 additions and 2 deletions
|
@ -22,7 +22,7 @@ namespace MWMechanics
|
||||||
mKnockdown(false), mKnockdownOneFrame(false), mKnockdownOverOneFrame(false),
|
mKnockdown(false), mKnockdownOneFrame(false), mKnockdownOverOneFrame(false),
|
||||||
mHitRecovery(false), mBlock(false), mMovementFlags(0),
|
mHitRecovery(false), mBlock(false), mMovementFlags(0),
|
||||||
mFallHeight(0), mRecalcMagicka(false), mLastRestock(0,0), mGoldPool(0), mActorId(-1),
|
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)
|
for (int i=0; i<4; ++i)
|
||||||
mAiSettings[i] = 0;
|
mAiSettings[i] = 0;
|
||||||
|
|
|
@ -893,7 +893,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
const MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
|
const MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
|
||||||
static const float fCorpseClearDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCorpseClearDelay")->getFloat();
|
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);
|
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,8 @@ void ESM::CreatureStats::load (ESMReader &esm)
|
||||||
mDeathAnimation = 0;
|
mDeathAnimation = 0;
|
||||||
esm.getHNOT (mDeathAnimation, "DANM");
|
esm.getHNOT (mDeathAnimation, "DANM");
|
||||||
|
|
||||||
|
mTimeOfDeath.mDay = 0;
|
||||||
|
mTimeOfDeath.mHour = 0;
|
||||||
esm.getHNOT (mTimeOfDeath, "DTIM");
|
esm.getHNOT (mTimeOfDeath, "DTIM");
|
||||||
|
|
||||||
mSpells.load(esm);
|
mSpells.load(esm);
|
||||||
|
|
Loading…
Reference in a new issue