mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-03 01:45:33 +00:00
resize actor collision boxes on death
This commit is contained in:
parent
e88040662e
commit
b095c24854
4 changed files with 22 additions and 0 deletions
|
@ -345,6 +345,8 @@ namespace MWBase
|
||||||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
||||||
///< get all items in active cells owned by this Npc
|
///< get all items in active cells owned by this Npc
|
||||||
|
|
||||||
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
|
||||||
|
|
||||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
|
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
|
||||||
|
|
||||||
virtual int canRest() = 0;
|
virtual int canRest() = 0;
|
||||||
|
|
|
@ -462,6 +462,10 @@ void CharacterController::update(float duration, Movement &movement)
|
||||||
mAnimation->disable("torch");
|
mAnimation->disable("torch");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (cls.getCreatureStats(mPtr).isDead())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWorld()->enableActorCollision(mPtr, false);
|
||||||
|
}
|
||||||
|
|
||||||
if(mAnimation && !mSkipAnim)
|
if(mAnimation && !mSkipAnim)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1751,4 +1751,18 @@ namespace MWWorld
|
||||||
out.push_back(searchPtrViaHandle(*it));
|
out.push_back(searchPtrViaHandle(*it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::enableActorCollision(const MWWorld::Ptr& actor, bool enable)
|
||||||
|
{
|
||||||
|
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||||
|
|
||||||
|
if (!enable)
|
||||||
|
{
|
||||||
|
physicActor->setScale(0.15);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
physicActor->setScale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,6 +394,8 @@ namespace MWWorld
|
||||||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out);
|
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out);
|
||||||
///< get all items in active cells owned by this Npc
|
///< get all items in active cells owned by this Npc
|
||||||
|
|
||||||
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable);
|
||||||
|
|
||||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
|
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
|
||||||
|
|
||||||
virtual int canRest();
|
virtual int canRest();
|
||||||
|
|
Loading…
Reference in a new issue