mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-20 13:53:53 +00:00
Make collision events available on every frame (thanks, scrawl), make hurtStandingActor and hurtCollidingActor no-op in guimode
This commit is contained in:
parent
2162a9e1b9
commit
a5e972aeb5
2 changed files with 10 additions and 4 deletions
|
@ -829,15 +829,15 @@ namespace MWWorld
|
|||
|
||||
const PtrVelocityList& PhysicsSystem::applyQueuedMovement(float dt)
|
||||
{
|
||||
// Collision events are only tracked for a single frame, so reset first
|
||||
mCollisions.clear();
|
||||
mStandingCollisions.clear();
|
||||
|
||||
mMovementResults.clear();
|
||||
|
||||
mTimeAccum += dt;
|
||||
if(mTimeAccum >= 1.0f/60.0f)
|
||||
{
|
||||
// Collision events should be available on every frame
|
||||
mCollisions.clear();
|
||||
mStandingCollisions.clear();
|
||||
|
||||
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
PtrVelocityList::iterator iter = mMovementQueue.begin();
|
||||
for(;iter != mMovementQueue.end();++iter)
|
||||
|
|
|
@ -2078,6 +2078,9 @@ namespace MWWorld
|
|||
|
||||
void World::hurtStandingActors(const Ptr &object, float healthPerSecond)
|
||||
{
|
||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||
return;
|
||||
|
||||
std::vector<std::string> actors;
|
||||
mPhysics->getActorsStandingOn(object, actors);
|
||||
for (std::vector<std::string>::iterator it = actors.begin(); it != actors.end(); ++it)
|
||||
|
@ -2106,6 +2109,9 @@ namespace MWWorld
|
|||
|
||||
void World::hurtCollidingActors(const Ptr &object, float healthPerSecond)
|
||||
{
|
||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||
return;
|
||||
|
||||
std::vector<std::string> actors;
|
||||
mPhysics->getActorsCollidingWith(object, actors);
|
||||
for (std::vector<std::string>::iterator it = actors.begin(); it != actors.end(); ++it)
|
||||
|
|
Loading…
Reference in a new issue