Skip to content

Commit

Permalink
Make sure to capture floating point return values from lua
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarex committed Aug 1, 2015
1 parent 0352d9c commit 94f44e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contractor/edge_based_graph_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ int EdgeBasedGraphFactory::GetTurnPenalty(double angle, lua_State *lua_state) co
try
{
// call lua profile to compute turn penalty
return luabind::call_function<int>(lua_state, "turn_function", 180. - angle);
double penalty = luabind::call_function<double>(lua_state, "turn_function", 180. - angle);
return static_cast<int>(penalty);
}
catch (const luabind::error &er)
{
Expand Down

0 comments on commit 94f44e1

Please sign in to comment.