mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-02 00:10:22 +02:00
Apply fixes to pathfinder
This commit is contained in:
parent
d46364c4c3
commit
1bcfa986e4
@ -479,11 +479,12 @@ CPathsInfo::~CPathsInfo()
|
||||
delete [] nodes;
|
||||
}
|
||||
|
||||
const CGPathNode * CPathsInfo::getPathInfo( int3 tile ) const
|
||||
const CGPathNode * CPathsInfo::getPathInfo(const int3& tile) const
|
||||
{
|
||||
boost::unique_lock<boost::mutex> pathLock(pathMx);
|
||||
|
||||
if(tile.x >= sizes.x || tile.y >= sizes.y || tile.z >= sizes.z)
|
||||
if(tile.x >= sizes.x || tile.y >= sizes.y || tile.z >= sizes.z
|
||||
|| tile.x < 0 || tile.y < 0 || tile.z < 0)
|
||||
return nullptr;
|
||||
return &nodes[tile.x][tile.y][tile.z];
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ struct DLL_LINKAGE CPathsInfo
|
||||
|
||||
CPathsInfo(const int3 &Sizes);
|
||||
~CPathsInfo();
|
||||
const CGPathNode * getPathInfo( int3 tile ) const;
|
||||
const CGPathNode * getPathInfo(const int3& tile) const;
|
||||
bool getPath(const int3 &dst, CGPath &out) const;
|
||||
int getDistance( int3 tile ) const;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user