mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Add MWWorld::isSlowFalling(Ptr)
This commit is contained in:
parent
6e09a5fb4a
commit
4265dddc40
@ -324,6 +324,7 @@ namespace MWBase
|
|||||||
virtual void processChangedSettings (const Settings::CategorySettingVector& settings) = 0;
|
virtual void processChangedSettings (const Settings::CategorySettingVector& settings) = 0;
|
||||||
|
|
||||||
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0;
|
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0;
|
||||||
|
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const = 0;
|
||||||
virtual bool isSwimming(const MWWorld::Ptr &object) const = 0;
|
virtual bool isSwimming(const MWWorld::Ptr &object) const = 0;
|
||||||
///Is the head of the creature underwater?
|
///Is the head of the creature underwater?
|
||||||
virtual bool isSubmerged(const MWWorld::Ptr &object) const = 0;
|
virtual bool isSubmerged(const MWWorld::Ptr &object) const = 0;
|
||||||
|
@ -1582,6 +1582,19 @@ namespace MWWorld
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
World::isSlowFalling(const MWWorld::Ptr &ptr) const
|
||||||
|
{
|
||||||
|
if(!ptr.getClass().isActor())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
|
if(stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::SlowFall)).mMagnitude > 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool World::isSubmerged(const MWWorld::Ptr &object) const
|
bool World::isSubmerged(const MWWorld::Ptr &object) const
|
||||||
{
|
{
|
||||||
float *fpos = object.getRefData().getPosition().pos;
|
float *fpos = object.getRefData().getPosition().pos;
|
||||||
|
@ -355,6 +355,7 @@ namespace MWWorld
|
|||||||
virtual void processChangedSettings(const Settings::CategorySettingVector& settings);
|
virtual void processChangedSettings(const Settings::CategorySettingVector& settings);
|
||||||
|
|
||||||
virtual bool isFlying(const MWWorld::Ptr &ptr) const;
|
virtual bool isFlying(const MWWorld::Ptr &ptr) const;
|
||||||
|
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const;
|
||||||
///Is the head of the creature underwater?
|
///Is the head of the creature underwater?
|
||||||
virtual bool isSubmerged(const MWWorld::Ptr &object) const;
|
virtual bool isSubmerged(const MWWorld::Ptr &object) const;
|
||||||
virtual bool isSwimming(const MWWorld::Ptr &object) const;
|
virtual bool isSwimming(const MWWorld::Ptr &object) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user