Add assert check for graph.xml

This commit is contained in:
Benau 2016-09-04 13:15:51 +08:00
parent 23a49d5245
commit 9d41f4b429
3 changed files with 4 additions and 8 deletions

View File

@ -66,6 +66,7 @@ namespace irr
* stage) identical to the Skidding AI.
\ingroup controller
*/
class TestAI : public AIBaseLapController
{
private:

View File

@ -95,14 +95,6 @@ NavMesh::NavMesh(const std::string &filename)
m_quads.push_back(new Quad(
all_vertices[quad_index[0]], all_vertices[quad_index[1]],
all_vertices[quad_index[2]], all_vertices[quad_index[3]]));
/*(AbstractNode* tn = createNode(
all_vertices[quad_index[0]], all_vertices[quad_index[1]],
all_vertices[quad_index[2]], all_vertices[quad_index[3]],false,false);
Vec3 pp(0,0,0);
tn->pointInNode(pp);*/
}
}
}

View File

@ -223,6 +223,9 @@ void QuadGraph::load(const std::string &quad_file_name,
if(xml_node->getName()=="node-list")
{
// Each quad is part of the graph exactly once now.
unsigned int to = 0;
xml_node->get("to-quad", &to);
assert(to + 1 == m_all_nodes.size());
continue;
}
else if(xml_node->getName()=="edge-loop")