From 22c5c539c2fdc6bca9158dd7d300009354aca067 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Thu, 7 Feb 2013 16:16:39 +0100 Subject: [PATCH] default to using turn restrictions --- Extractor/PBFParser.cpp | 6 ++++-- profiles/bicycle.lua | 1 - profiles/car.lua | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Extractor/PBFParser.cpp b/Extractor/PBFParser.cpp index 299275b12..3280e7e81 100644 --- a/Extractor/PBFParser.cpp +++ b/Extractor/PBFParser.cpp @@ -47,8 +47,10 @@ void PBFParser::RegisterScriptingEnvironment(ScriptingEnvironment & _se) { if(0 != luaL_dostring( scriptingEnvironment.getLuaStateForThreadID(0), "return use_turn_restrictions\n")) { ERR(lua_tostring(scriptingEnvironment.getLuaStateForThreadID(0),-1)<< " occured in scripting block"); } - use_turn_restrictions = lua_toboolean(scriptingEnvironment.getLuaStateForThreadID(0), -1); - INFO("Use turn restrictions:" << use_turn_restrictions); + if( lua_isboolean(scriptingEnvironment.getLuaStateForThreadID(0), -1) ) { + use_turn_restrictions = lua_toboolean(scriptingEnvironment.getLuaStateForThreadID(0), -1); + } + INFO("Use turn restrictions: " << (use_turn_restrictions ? "yes" : "no")); if(lua_function_exists(scriptingEnvironment.getLuaStateForThreadID(0), "get_exceptions" )) { //get list of turn restriction exceptions diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 2f476e307..cb07ea6fb 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -72,7 +72,6 @@ use_restrictions = true ignore_areas = true -- future feature traffic_signal_penalty = 2 u_turn_penalty = 20 -use_turn_restrictions = true -- End of globals diff --git a/profiles/car.lua b/profiles/car.lua index d2fa5cea3..095806590 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -39,7 +39,6 @@ use_restrictions = true ignore_areas = true -- future feature traffic_signal_penalty = 2 u_turn_penalty = 20 -use_turn_restrictions = true -- End of globals