Avoid SegFault in Router

parent 142f87dc
......@@ -890,7 +890,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
}
else
{
if (_building->GetRoom(ped->GetRoomID())->GetCaption() != "outside")
if (_building->GetRoom(ped->GetRoomID())->GetCaption() != "outside" && relevantAPs.size()>0)
{
//Log->Write(
//
......@@ -1388,7 +1388,7 @@ string GlobalRouter::GetRoutingInfoFile()
//wronf
//router section
nav_line_file=e->FirstChild("parameters")->FirstChildElement("navigation_lines")->Attribute("file");
TiXmlElement* para =e->FirstChild("parameters")->FirstChildElement("navigation_mesh");
if (para)
{
......@@ -1491,7 +1491,7 @@ bool GlobalRouter::LoadRoutingInfos(const std::string &filename)
if(_building->AddHline(h))
{
subroom->AddHline(h);
HlineCount++;
HlineCount++;
//h is freed in building
}
else
......@@ -1619,7 +1619,7 @@ double GlobalRouter::MinAngle(const Point& p1, const Point& p2, const Point& p3)
if(fabs(alpha+beta+gamma-M_PI)<J_EPS)
{
std::vector<double> vec = { alpha, beta, gamma };
std::vector<double> vec = { alpha, beta, gamma };
return *std::min_element(vec.begin(), vec.end()) * (180.0 / M_PI);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment