small corrections in grand_prix_data.cpp
This commit is contained in:
parent
367acd7738
commit
b0169d2896
@ -89,8 +89,8 @@ void GrandPrixData::reload()
|
|||||||
{
|
{
|
||||||
Log::error("GrandPrixData",
|
Log::error("GrandPrixData",
|
||||||
"Error while trying to read Grand Prix file '%s': "
|
"Error while trying to read Grand Prix file '%s': "
|
||||||
"Root node has the wrong name %s", m_filename.c_str()),
|
"Root node has the wrong name %s", m_filename.c_str(),
|
||||||
root->getName().c_str();
|
root->getName().c_str());
|
||||||
throw std::runtime_error("Wrong root node name");
|
throw std::runtime_error("Wrong root node name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ void GrandPrixData::reload()
|
|||||||
if (node->getName() != "track")
|
if (node->getName() != "track")
|
||||||
{
|
{
|
||||||
Log::error("GrandPrixData"
|
Log::error("GrandPrixData"
|
||||||
"Unknown node in Grand Prix XML file ': %s",
|
"Unknown node in Grand Prix XML file '%s': %s",
|
||||||
m_filename.c_str(), node->getName().c_str());
|
m_filename.c_str(), node->getName().c_str());
|
||||||
throw std::runtime_error("Unknown node in the XML file");
|
throw std::runtime_error("Unknown node in the XML file");
|
||||||
}
|
}
|
||||||
@ -122,17 +122,17 @@ void GrandPrixData::reload()
|
|||||||
{
|
{
|
||||||
Log::error("GrandPrixData",
|
Log::error("GrandPrixData",
|
||||||
"The id attribute is missing in the %d. track entry of "
|
"The id attribute is missing in the %d. track entry of "
|
||||||
"the Grand Prix xml file '%s'.", i, m_filename.c_str());
|
"the Grand Prix file '%s'.", i, m_filename.c_str());
|
||||||
throw std::runtime_error("Missing track id");
|
throw std::runtime_error("Missing track id");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1.1 Checking if the track exists
|
// 1.1 Checking if the track exists
|
||||||
Track* t = track_manager->getTrack(track_id);
|
Track* t = track_manager->getTrack(track_id);
|
||||||
if (t != NULL)
|
if (t == NULL)
|
||||||
{
|
{
|
||||||
Log::error("GrandPrixData",
|
Log::error("GrandPrixData",
|
||||||
"Grand Prix '%s' contains a track '%s' that does not "
|
"The Grand Prix file '%s' contains a track '%s' that "
|
||||||
"exist", m_filename.c_str(), track_id.c_str());
|
"does not exist", m_filename.c_str(), track_id.c_str());
|
||||||
throw std::runtime_error("Unknown track");
|
throw std::runtime_error("Unknown track");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,16 +142,15 @@ void GrandPrixData::reload()
|
|||||||
{
|
{
|
||||||
Log::error("GrandPrixData",
|
Log::error("GrandPrixData",
|
||||||
"The laps attribute is missing in the %d. track entry "
|
"The laps attribute is missing in the %d. track entry "
|
||||||
"of the Grand Prix xml file '%s'.", i,
|
"of the Grand Prix file '%s'.", i, m_filename.c_str());
|
||||||
m_filename.c_str());
|
|
||||||
throw std::runtime_error("Missing track id");
|
throw std::runtime_error("Missing track id");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (number_of_laps < 1)
|
if (number_of_laps < 1)
|
||||||
{
|
{
|
||||||
Log::error("GrandPrixData",
|
Log::error("GrandPrixData",
|
||||||
"Track '%s' in Grand Prix '%s' should be raced with %d "
|
"Track '%s' in the Grand Prix file '%s' should be raced "
|
||||||
"laps, which isn't possible.", track_id.c_str(),
|
"with %d laps, which isn't possible.", track_id.c_str(),
|
||||||
m_filename.c_str());
|
m_filename.c_str());
|
||||||
throw std::runtime_error("Lap count lower than 1");
|
throw std::runtime_error("Lap count lower than 1");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user