2015-08-21 09:12:39 +00:00
|
|
|
#include "actorutil.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
|
2019-06-05 08:40:38 +00:00
|
|
|
#include "../mwworld/class.hpp"
|
2015-09-10 06:48:34 +00:00
|
|
|
#include "../mwworld/player.hpp"
|
|
|
|
|
2015-08-21 09:12:39 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
MWWorld::Ptr getPlayer()
|
|
|
|
{
|
|
|
|
return MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
}
|
2015-09-10 06:48:34 +00:00
|
|
|
|
|
|
|
bool isPlayerInCombat()
|
|
|
|
{
|
|
|
|
return MWBase::Environment::get().getWorld()->getPlayer().isInCombat();
|
|
|
|
}
|
2019-06-05 08:40:38 +00:00
|
|
|
|
|
|
|
bool canActorMoveByZAxis(const MWWorld::Ptr& actor)
|
|
|
|
{
|
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
|
|
|
return (actor.getClass().canSwim(actor) && world->isSwimming(actor)) || world->isFlying(actor);
|
|
|
|
}
|
2015-08-21 09:12:39 +00:00
|
|
|
}
|