mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
When a summoned creature dies, wait for its death animation to complete before removing it (Bug #3439)
This commit is contained in:
parent
a825882c6b
commit
b7e45b046d
1 changed files with 1 additions and 3 deletions
|
@ -26,8 +26,6 @@ namespace MWMechanics
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(creatureActorId);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(creatureActorId);
|
||||||
if (!ptr.isEmpty())
|
if (!ptr.isEmpty())
|
||||||
{
|
{
|
||||||
// TODO: Show death animation before deleting? We shouldn't allow looting the corpse while the animation
|
|
||||||
// plays though, which is a rather lame exploit in vanilla.
|
|
||||||
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||||
|
|
||||||
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
||||||
|
@ -157,7 +155,7 @@ namespace MWMechanics
|
||||||
for (std::map<CreatureStats::SummonKey, int>::iterator it = creatureMap.begin(); it != creatureMap.end(); )
|
for (std::map<CreatureStats::SummonKey, int>::iterator it = creatureMap.begin(); it != creatureMap.end(); )
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second);
|
||||||
if (!ptr.isEmpty() && ptr.getClass().getCreatureStats(ptr).isDead())
|
if (!ptr.isEmpty() && ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished())
|
||||||
{
|
{
|
||||||
// Purge the magic effect so a new creature can be summoned if desired
|
// Purge the magic effect so a new creature can be summoned if desired
|
||||||
creatureStats.getActiveSpells().purgeEffect(it->first.first, it->first.second);
|
creatureStats.getActiveSpells().purgeEffect(it->first.first, it->first.second);
|
||||||
|
|
Loading…
Reference in a new issue