Make sure to capture floating point return values from lua

This commit is contained in:
Patrick Niklaus 2015-08-01 17:46:47 +02:00
parent 0352d9c99e
commit 94f44e1d5d

View File

@ -532,7 +532,8 @@ int EdgeBasedGraphFactory::GetTurnPenalty(double angle, lua_State *lua_state) co
try try
{ {
// call lua profile to compute turn penalty // 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) catch (const luabind::error &er)
{ {