forked from Mirrorlandia_minetest/minetest
fix bug in scriptapi line_of_sight
fix warnings for pathfinder debug traces
This commit is contained in:
parent
6e4fdf37ba
commit
dda2071cc0
@ -687,9 +687,8 @@ bool pathfinder::update_all_costs( v3s16 ipos,
|
|||||||
|
|
||||||
if ((g_pos2.totalcost < 0) ||
|
if ((g_pos2.totalcost < 0) ||
|
||||||
(g_pos2.totalcost > new_cost)) {
|
(g_pos2.totalcost > new_cost)) {
|
||||||
int old_cost = g_pos2.totalcost;
|
|
||||||
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
|
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
|
||||||
PPOS(ipos2) << " from: " << old_cost << " to "<<
|
PPOS(ipos2) << " from: " << g_pos2.totalcost << " to "<<
|
||||||
new_cost << std::endl);
|
new_cost << std::endl);
|
||||||
if (update_all_costs(ipos2,invert(directions[i]),
|
if (update_all_costs(ipos2,invert(directions[i]),
|
||||||
new_cost,level)) {
|
new_cost,level)) {
|
||||||
@ -847,9 +846,8 @@ bool pathfinder::update_cost_heuristic( v3s16 ipos,
|
|||||||
|
|
||||||
if ((g_pos2.totalcost < 0) ||
|
if ((g_pos2.totalcost < 0) ||
|
||||||
(g_pos2.totalcost > new_cost)) {
|
(g_pos2.totalcost > new_cost)) {
|
||||||
int old_cost = g_pos2.totalcost;
|
|
||||||
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
|
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
|
||||||
PPOS(ipos2) << " from: " << old_cost << " to "<<
|
PPOS(ipos2) << " from: " << g_pos2.totalcost << " to "<<
|
||||||
new_cost << " srcdir=" <<
|
new_cost << " srcdir=" <<
|
||||||
PPOS(invert(direction))<< std::endl);
|
PPOS(invert(direction))<< std::endl);
|
||||||
if (update_cost_heuristic(ipos2,invert(direction),
|
if (update_cost_heuristic(ipos2,invert(direction),
|
||||||
|
@ -664,7 +664,9 @@ int EnvRef::l_line_of_sight(lua_State *L) {
|
|||||||
if(lua_isnumber(L, 3))
|
if(lua_isnumber(L, 3))
|
||||||
stepsize = lua_tonumber(L, 3);
|
stepsize = lua_tonumber(L, 3);
|
||||||
|
|
||||||
return (env->line_of_sight(pos1,pos2,stepsize));
|
lua_pushboolean(L, env->line_of_sight(pos1,pos2,stepsize));
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EnvRef::l_find_path(lua_State *L)
|
int EnvRef::l_find_path(lua_State *L)
|
||||||
|
Loading…
Reference in New Issue
Block a user