Skip to content

Commit

Permalink
fix bug in scriptapi line_of_sight
Browse files Browse the repository at this point in the history
fix warnings for pathfinder debug traces
  • Loading branch information
sapier authored and kwolekr committed Apr 10, 2013
1 parent 6e4fdf3 commit dda2071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/pathfinder.cpp
Expand Up @@ -687,9 +687,8 @@ bool pathfinder::update_all_costs( v3s16 ipos,

if ((g_pos2.totalcost < 0) ||
(g_pos2.totalcost > new_cost)) {
int old_cost = g_pos2.totalcost;
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
PPOS(ipos2) << " from: " << old_cost << " to "<<
PPOS(ipos2) << " from: " << g_pos2.totalcost << " to "<<
new_cost << std::endl);
if (update_all_costs(ipos2,invert(directions[i]),
new_cost,level)) {
Expand Down Expand Up @@ -847,9 +846,8 @@ bool pathfinder::update_cost_heuristic( v3s16 ipos,

if ((g_pos2.totalcost < 0) ||
(g_pos2.totalcost > new_cost)) {
int old_cost = g_pos2.totalcost;
DEBUG_OUT(LVL "Pathfinder: updating path at: "<<
PPOS(ipos2) << " from: " << old_cost << " to "<<
PPOS(ipos2) << " from: " << g_pos2.totalcost << " to "<<
new_cost << " srcdir=" <<
PPOS(invert(direction))<< std::endl);
if (update_cost_heuristic(ipos2,invert(direction),
Expand Down
6 changes: 4 additions & 2 deletions src/scriptapi_env.cpp
Expand Up @@ -662,9 +662,11 @@ int EnvRef::l_line_of_sight(lua_State *L) {
v3f pos2 = checkFloatPos(L, 2);
//read step size from lua
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)
Expand Down

0 comments on commit dda2071

Please sign in to comment.