AITravel Cleanup - Removed unnecessary includes and other varius cleanups.

actorid
Torben Carrington 12 years ago
parent b1a8dc35e0
commit 56b1384c90

@ -1,18 +1,12 @@
#include "aitravel.hpp"
#include <iostream>
#include "character.hpp"
#include "movement.hpp"
#include "../mwworld/class.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "movement.hpp"
#include "../mwworld/player.hpp"
#include <boost/graph/astar_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include "boost/tuple/tuple.hpp"
namespace
{
float sgn(float a)
@ -22,20 +16,17 @@ namespace
}
}
namespace MWMechanics
{
AiTravel::AiTravel(float x, float y, float z)
MWMechanics::AiTravel::AiTravel(float x, float y, float z)
: mX(x),mY(y),mZ(z),mPathFinder()
{
}
AiTravel * AiTravel::clone() const
MWMechanics::AiTravel *MWMechanics::AiTravel::clone() const
{
return new AiTravel(*this);
}
bool AiTravel::execute (const MWWorld::Ptr& actor)
bool MWMechanics::AiTravel::execute (const MWWorld::Ptr& actor)
{
const ESM::Pathgrid *pathgrid =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*actor.getCell()->mCell);
@ -89,6 +80,7 @@ namespace MWMechanics
mPathFinder.buildPath(start,dest,pathgrid,xCell,yCell);
}
if(mPathFinder.checkIfNextPointReached(pos.pos[0],pos.pos[1],pos.pos[2]))
{
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 0;
@ -102,9 +94,7 @@ namespace MWMechanics
return false;
}
int AiTravel::getTypeId() const
int MWMechanics::AiTravel::getTypeId() const
{
return 1;
}
}

@ -2,6 +2,7 @@
#define GAME_MWMECHANICS_AITRAVEL_H
#include "aipackage.hpp"
#include "pathfinding.hpp"
namespace MWMechanics
@ -25,10 +26,7 @@ namespace MWMechanics
int cellX;
int cellY;
//bool isPathConstructed;
//std::list<ESM::Pathgrid::Point> mPath;
PathFinder mPathFinder;
};
}

Loading…
Cancel
Save