diff options
author | Jozef Behran <jozuejozef@gmail.com> | 2019-08-10 19:45:44 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-08-10 19:45:44 +0200 |
commit | 86d7f84b899a507e979f1845f2057cce6f84e743 (patch) | |
tree | ec2d965d61bd639fe879f971b98e30bccab63b52 /src/pathfinder.cpp | |
parent | 291e7730cf24ba5081f10b5ddbf2494951333827 (diff) | |
download | minetest-86d7f84b899a507e979f1845f2057cce6f84e743.tar.gz minetest-86d7f84b899a507e979f1845f2057cce6f84e743.tar.bz2 minetest-86d7f84b899a507e979f1845f2057cce6f84e743.zip |
Merge pull request #8776 from osjc/FixGetNode
Finish getNode cleanup
Diffstat (limited to 'src/pathfinder.cpp')
-rw-r--r-- | src/pathfinder.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pathfinder.cpp b/src/pathfinder.cpp index 8f6033813..48e951477 100644 --- a/src/pathfinder.cpp +++ b/src/pathfinder.cpp @@ -498,8 +498,8 @@ void GridNodeContainer::initNode(v3s16 ipos, PathGridnode *p_node) v3s16 realpos = m_pathf->getRealPos(ipos); - MapNode current = m_pathf->m_env->getMap().getNodeNoEx(realpos); - MapNode below = m_pathf->m_env->getMap().getNodeNoEx(realpos + v3s16(0, -1, 0)); + MapNode current = m_pathf->m_env->getMap().getNode(realpos); + MapNode below = m_pathf->m_env->getMap().getNode(realpos + v3s16(0, -1, 0)); if ((current.param0 == CONTENT_IGNORE) || @@ -769,7 +769,7 @@ PathCost Pathfinder::calcCost(v3s16 pos, v3s16 dir) return retval; } - MapNode node_at_pos2 = m_env->getMap().getNodeNoEx(pos2); + MapNode node_at_pos2 = m_env->getMap().getNode(pos2); //did we get information about node? if (node_at_pos2.param0 == CONTENT_IGNORE ) { @@ -780,7 +780,7 @@ PathCost Pathfinder::calcCost(v3s16 pos, v3s16 dir) if (!ndef->get(node_at_pos2).walkable) { MapNode node_below_pos2 = - m_env->getMap().getNodeNoEx(pos2 + v3s16(0, -1, 0)); + m_env->getMap().getNode(pos2 + v3s16(0, -1, 0)); //did we get information about node? if (node_below_pos2.param0 == CONTENT_IGNORE ) { @@ -798,13 +798,13 @@ PathCost Pathfinder::calcCost(v3s16 pos, v3s16 dir) } else { v3s16 testpos = pos2 - v3s16(0, -1, 0); - MapNode node_at_pos = m_env->getMap().getNodeNoEx(testpos); + MapNode node_at_pos = m_env->getMap().getNode(testpos); while ((node_at_pos.param0 != CONTENT_IGNORE) && (!ndef->get(node_at_pos).walkable) && (testpos.Y > m_limits.MinEdge.Y)) { testpos += v3s16(0, -1, 0); - node_at_pos = m_env->getMap().getNodeNoEx(testpos); + node_at_pos = m_env->getMap().getNode(testpos); } //did we find surface? @@ -832,13 +832,13 @@ PathCost Pathfinder::calcCost(v3s16 pos, v3s16 dir) } else { v3s16 testpos = pos2; - MapNode node_at_pos = m_env->getMap().getNodeNoEx(testpos); + MapNode node_at_pos = m_env->getMap().getNode(testpos); while ((node_at_pos.param0 != CONTENT_IGNORE) && (ndef->get(node_at_pos).walkable) && (testpos.Y < m_limits.MaxEdge.Y)) { testpos += v3s16(0, 1, 0); - node_at_pos = m_env->getMap().getNodeNoEx(testpos); + node_at_pos = m_env->getMap().getNode(testpos); } //did we find surface? |