1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Fix compile error & warnings

This commit is contained in:
scrawl 2013-03-26 18:01:01 +01:00
parent 2ecd2f4ecd
commit efe6a3ebee
2 changed files with 33 additions and 33 deletions

View File

@ -46,7 +46,7 @@ int getClosestPoint(const ESM::Pathgrid* grid,float x,float y,float z)
float m = distance(grid->mPoints[0],x,y,z);
int i0 = 0;
for(int i=1; i<grid->mPoints.size();i++)
for(unsigned int i=1; i<grid->mPoints.size();++i)
{
if(distance(grid->mPoints[i],x,y,z)<m)
{
@ -139,7 +139,7 @@ PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCe
{
PathGridGraph graph;
for(int i = 0;i<pathgrid->mPoints.size();i++)
for(unsigned int i = 0;i<pathgrid->mPoints.size();++i)
{
PointID pID = boost::add_vertex(graph);
graph[pID].mX = pathgrid->mPoints[i].mX + xCell;
@ -147,7 +147,7 @@ PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCe
graph[pID].mZ = pathgrid->mPoints[i].mZ;
}
for(int i = 0;i<pathgrid->mEdges.size();i++)
for(unsigned int i = 0;i<pathgrid->mEdges.size();++i)
{
PointID u = pathgrid->mEdges[i].mV0;
PointID v = pathgrid->mEdges[i].mV1;

View File

@ -1,35 +1,35 @@
#ifndef GAME_MWMECHANICS_AITRAVEL_H
#define GAME_MWMECHANICS_AITRAVEL_H
#include "aipackage.hpp"
#include "components\esm\loadpgrd.hpp"
#include <list>
namespace MWMechanics
{
class AiTravel : public AiPackage
{
public:
AiTravel(float x, float y, float z);
virtual AiTravel *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
private:
float mX;
float mY;
float mZ;
int cellX;
int cellY;
bool isPathConstructed;
std::list<ESM::Pathgrid::Point> mPath;
};
#include "aipackage.hpp"
#include <components/esm/loadpgrd.hpp>
#include <list>
namespace MWMechanics
{
class AiTravel : public AiPackage
{
public:
AiTravel(float x, float y, float z);
virtual AiTravel *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
private:
float mX;
float mY;
float mZ;
int cellX;
int cellY;
bool isPathConstructed;
std::list<ESM::Pathgrid::Point> mPath;
};
}
#endif