mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 22:19:54 +00:00
Do not clear corpses until end of death animation (bug #4307)
This commit is contained in:
parent
a42c663fd7
commit
977a27ecb7
4 changed files with 16 additions and 8 deletions
|
@ -136,7 +136,7 @@ namespace MWClass
|
||||||
data->mCreatureStats.setAiSetting (MWMechanics::CreatureStats::AI_Alarm, ref->mBase->mAiData.mAlarm);
|
data->mCreatureStats.setAiSetting (MWMechanics::CreatureStats::AI_Alarm, ref->mBase->mAiData.mAlarm);
|
||||||
|
|
||||||
if (data->mCreatureStats.isDead())
|
if (data->mCreatureStats.isDead())
|
||||||
data->mCreatureStats.setDeathAnimationFinished(true);
|
data->mCreatureStats.setDeathAnimationFinished(ptr.getClass().isPersistent(ptr));
|
||||||
|
|
||||||
// spells
|
// spells
|
||||||
for (std::vector<std::string>::const_iterator iter (ref->mBase->mSpells.mList.begin());
|
for (std::vector<std::string>::const_iterator iter (ref->mBase->mSpells.mList.begin());
|
||||||
|
@ -814,6 +814,9 @@ namespace MWClass
|
||||||
if (ptr.getRefData().getCount() > 0 && !creatureStats.isDead())
|
if (ptr.getRefData().getCount() > 0 && !creatureStats.isDead())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!creatureStats.isDeathAnimationFinished())
|
||||||
|
return;
|
||||||
|
|
||||||
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat();
|
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat();
|
||||||
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat();
|
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat();
|
||||||
|
|
|
@ -353,7 +353,7 @@ namespace MWClass
|
||||||
data->mNpcStats.setNeedRecalcDynamicStats(true);
|
data->mNpcStats.setNeedRecalcDynamicStats(true);
|
||||||
}
|
}
|
||||||
if (data->mNpcStats.isDead())
|
if (data->mNpcStats.isDead())
|
||||||
data->mNpcStats.setDeathAnimationFinished(true);
|
data->mNpcStats.setDeathAnimationFinished(ptr.getClass().isPersistent(ptr));
|
||||||
|
|
||||||
// race powers
|
// race powers
|
||||||
const ESM::Race *race = MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);
|
const ESM::Race *race = MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);
|
||||||
|
@ -1351,6 +1351,9 @@ namespace MWClass
|
||||||
if (ptr.getRefData().getCount() > 0 && !creatureStats.isDead())
|
if (ptr.getRefData().getCount() > 0 && !creatureStats.isDead())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!creatureStats.isDeathAnimationFinished())
|
||||||
|
return;
|
||||||
|
|
||||||
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat();
|
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat();
|
||||||
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat();
|
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat();
|
||||||
|
|
|
@ -2029,13 +2029,10 @@ void CharacterController::update(float duration)
|
||||||
{
|
{
|
||||||
// initial start of death animation for actors that started the game as dead
|
// initial start of death animation for actors that started the game as dead
|
||||||
// not done in constructor since we need to give scripts a chance to set the mSkipAnim flag
|
// not done in constructor since we need to give scripts a chance to set the mSkipAnim flag
|
||||||
if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty())
|
if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty() && cls.isPersistent(mPtr))
|
||||||
{
|
{
|
||||||
// Fast-forward death animation to end for persisting corpses
|
// Fast-forward death animation to end for persisting corpses
|
||||||
if (cls.isPersistent(mPtr))
|
playDeath(1.f, mDeathState);
|
||||||
playDeath(1.f, mDeathState);
|
|
||||||
else
|
|
||||||
playDeath(0.f, mDeathState);
|
|
||||||
}
|
}
|
||||||
// We must always queue movement, even if there is none, to apply gravity.
|
// We must always queue movement, even if there is none, to apply gravity.
|
||||||
world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f));
|
world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f));
|
||||||
|
|
|
@ -945,8 +945,13 @@ 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 (creatureStats.isDead() && !ptr.getClass().isPersistent(ptr) && creatureStats.getTimeOfDeath() + fCorpseClearDelay <= MWBase::Environment::get().getWorld()->getTimeStamp())
|
if (creatureStats.isDead() &&
|
||||||
|
creatureStats.isDeathAnimationFinished() &&
|
||||||
|
!ptr.getClass().isPersistent(ptr) &&
|
||||||
|
creatureStats.getTimeOfDeath() + fCorpseClearDelay <= MWBase::Environment::get().getWorld()->getTimeStamp())
|
||||||
|
{
|
||||||
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CellStore::respawn()
|
void CellStore::respawn()
|
||||||
|
|
Loading…
Reference in a new issue