summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
diff options
context:
space:
mode:
authorWuzzy <Wuzzy2@mail.ru>2020-03-05 12:07:52 +0100
committersfan5 <sfan5@live.de>2020-03-05 12:09:44 +0100
commit580e7e8eb902ae2faed36b4982e7e751e35f5201 (patch)
treedfb3d71a2d6777c1896a285585c8c798c92790ea /src/script/lua_api/l_env.cpp
parent6d8e2d2483715f05216be86a32f664bcbaac3efe (diff)
downloadminetest-580e7e8eb902ae2faed36b4982e7e751e35f5201.tar.gz
minetest-580e7e8eb902ae2faed36b4982e7e751e35f5201.tar.bz2
minetest-580e7e8eb902ae2faed36b4982e7e751e35f5201.zip
Fix pathfinder bugs: returning nil frequently, broken A*, jump through solid nodes (#9339)
* Fix pathfinder fail when startpos is over air * Note down pathfinder restrictions * Implement real A* search * Pathfinder: Implement buildPath non-recursively * Update find_path documentation * Pathfinder: Check if jump path is unobstructed * Pathfinder: Fix drop check first checking upwards * Pathfinder: Return nil if source or dest are solid * Pathfinder: Use priority queue for open list
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r--src/script/lua_api/l_env.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index a175569d8..352c75fb2 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -1194,7 +1194,7 @@ int ModApiEnvMod::l_find_path(lua_State *L)
unsigned int max_jump = luaL_checkint(L, 4);
unsigned int max_drop = luaL_checkint(L, 5);
PathAlgorithm algo = PA_PLAIN_NP;
- if (!lua_isnil(L, 6)) {
+ if (!lua_isnoneornil(L, 6)) {
std::string algorithm = luaL_checkstring(L,6);
if (algorithm == "A*")