mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Various random code cleanups
This commit is contained in:
parent
358658fa34
commit
7892541383
73 changed files with 216 additions and 285 deletions
|
@ -578,7 +578,7 @@ MapGridNodeContainer::MapGridNodeContainer(Pathfinder *pathf)
|
|||
|
||||
PathGridnode &MapGridNodeContainer::access(v3s16 p)
|
||||
{
|
||||
std::map<v3s16, PathGridnode>::iterator it = m_nodes.find(p);
|
||||
auto it = m_nodes.find(p);
|
||||
if (it != m_nodes.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
@ -758,8 +758,7 @@ std::vector<v3s16> Pathfinder::getPath(v3s16 source,
|
|||
}
|
||||
//convert all index positions to "normal" positions and insert
|
||||
//them into full_path in reverse
|
||||
std::vector<v3s16>::reverse_iterator rit = index_path.rbegin();
|
||||
for (; rit != index_path.rend(); ++rit) {
|
||||
for (auto rit = index_path.rbegin(); rit != index_path.rend(); ++rit) {
|
||||
full_path.push_back(getIndexElement(*rit).pos);
|
||||
}
|
||||
//manually add true_destination to end of path, if needed
|
||||
|
@ -1419,8 +1418,7 @@ std::string Pathfinder::dirToName(PathDirections dir)
|
|||
void Pathfinder::printPath(const std::vector<v3s16> &path)
|
||||
{
|
||||
unsigned int current = 0;
|
||||
for (std::vector<v3s16>::iterator i = path.begin();
|
||||
i != path.end(); ++i) {
|
||||
for (auto i = path.begin(); i != path.end(); ++i) {
|
||||
std::cout << std::setw(3) << current << ":" << *i << std::endl;
|
||||
current++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue