mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-22 16:20:58 +00:00
Do not build path by navigator for pure water and flying creatures
They don't need to move by surfaces and to open/close doors.
This commit is contained in:
parent
cb29dc7b85
commit
5405efd3b5
@ -286,7 +286,8 @@ namespace MWMechanics
|
|||||||
mPath.clear();
|
mPath.clear();
|
||||||
mCell = cell;
|
mCell = cell;
|
||||||
|
|
||||||
buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, std::back_inserter(mPath));
|
if (!actor.getClass().isPureWaterCreature(actor) && !actor.getClass().isPureFlyingCreature(actor))
|
||||||
|
buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, std::back_inserter(mPath));
|
||||||
|
|
||||||
if (mPath.empty())
|
if (mPath.empty())
|
||||||
buildPathByPathgridImpl(startPoint, endPoint, pathgridGraph, std::back_inserter(mPath));
|
buildPathByPathgridImpl(startPoint, endPoint, pathgridGraph, std::back_inserter(mPath));
|
||||||
|
@ -407,7 +407,7 @@ namespace MWWorld
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Class::isPureWaterCreature(const MWWorld::Ptr& ptr) const
|
bool Class::isPureWaterCreature(const ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
return canSwim(ptr)
|
return canSwim(ptr)
|
||||||
&& !isBipedal(ptr)
|
&& !isBipedal(ptr)
|
||||||
@ -415,7 +415,7 @@ namespace MWWorld
|
|||||||
&& !canWalk(ptr);
|
&& !canWalk(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Class::isPureFlyingCreature(const Ptr& ptr) const
|
bool Class::isPureFlyingCreature(const ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
return canFly(ptr)
|
return canFly(ptr)
|
||||||
&& !isBipedal(ptr)
|
&& !isBipedal(ptr)
|
||||||
|
@ -324,8 +324,8 @@ namespace MWWorld
|
|||||||
virtual bool canFly(const MWWorld::ConstPtr& ptr) const;
|
virtual bool canFly(const MWWorld::ConstPtr& ptr) const;
|
||||||
virtual bool canSwim(const MWWorld::ConstPtr& ptr) const;
|
virtual bool canSwim(const MWWorld::ConstPtr& ptr) const;
|
||||||
virtual bool canWalk(const MWWorld::ConstPtr& ptr) const;
|
virtual bool canWalk(const MWWorld::ConstPtr& ptr) const;
|
||||||
bool isPureWaterCreature(const MWWorld::Ptr& ptr) const;
|
bool isPureWaterCreature(const MWWorld::ConstPtr& ptr) const;
|
||||||
bool isPureFlyingCreature(const MWWorld::Ptr& ptr) const;
|
bool isPureFlyingCreature(const MWWorld::ConstPtr& ptr) const;
|
||||||
bool isPureLandCreature(const MWWorld::Ptr& ptr) const;
|
bool isPureLandCreature(const MWWorld::Ptr& ptr) const;
|
||||||
bool isMobile(const MWWorld::Ptr& ptr) const;
|
bool isMobile(const MWWorld::Ptr& ptr) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user