1
0
Fork 0
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:
sfan5 2025-03-01 11:53:37 +01:00
parent 358658fa34
commit 7892541383
73 changed files with 216 additions and 285 deletions

View file

@ -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++;
}