mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-02 15:15:35 +00:00
Somehow manages to get from one cell to another, but this looks wrong... And I don't know how morrowind do it, because aitravel is completly buggy
This commit is contained in:
parent
bbc4c23f7e
commit
f943580138
2 changed files with 8 additions and 1 deletions
|
@ -169,9 +169,13 @@ bool MWMechanics::AiTravel::execute (const MWWorld::Ptr& actor)
|
|||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*actor.getCell()->mCell);
|
||||
|
||||
ESM::Position pos = actor.getRefData().getPosition();
|
||||
bool cellChange = actor.getCell()->mCell->mData.mX != cellX || actor.getCell()->mCell->mData.mY != cellY;
|
||||
if(cellChange) std::cout << "cellChanged! \n";
|
||||
//std::cout << "npcpos" << pos.pos[0] << pos.pos[1] <<pos.pos[2] <<"\n";
|
||||
if(!isPathConstructed)
|
||||
if(!isPathConstructed ||cellChange)
|
||||
{
|
||||
cellX = actor.getCell()->mCell->mData.mX;
|
||||
cellY = actor.getCell()->mCell->mData.mY;
|
||||
float xCell = 0;
|
||||
float yCell = 0;
|
||||
if (actor.getCell()->mCell->isExterior())
|
||||
|
|
|
@ -23,6 +23,9 @@ namespace MWMechanics
|
|||
float mY;
|
||||
float mZ;
|
||||
|
||||
int cellX;
|
||||
int cellY;
|
||||
|
||||
bool isPathConstructed;
|
||||
std::list<ESM::Pathgrid::Point> mPath;
|
||||
|
||||
|
|
Loading…
Reference in a new issue