From fbf5bf41665c48cf3c2148ad71adf5c26c545355 Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 24 Jul 2014 17:43:11 +1000 Subject: [PATCH] Changed default number of laps to be 3 (and not the number of laps used last time), which seems to be a better default. Some minor cosmetic changes. --- src/race/grand_prix_data.cpp | 5 +++-- src/tracks/track.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/race/grand_prix_data.cpp b/src/race/grand_prix_data.cpp index 96de89ba8..ff7cb8380 100644 --- a/src/race/grand_prix_data.cpp +++ b/src/race/grand_prix_data.cpp @@ -111,13 +111,14 @@ void GrandPrixData::changeTrackNumber(const unsigned int number_of_tracks, rand() % available_tracks : track_indices[rand() % available_tracks]; - std::string id = track_manager->getTrack(index)->getIdent(); + const Track *track = track_manager->getTrack(index); + std::string id = track->getIdent(); // Avoid duplicate tracks if (std::find(m_tracks.begin(), m_tracks.end(), id) != m_tracks.end()) continue; m_tracks.push_back(id); - m_laps.push_back(track_manager->getTrack(index)->getDefaultNumberOfLaps()); + m_laps.push_back(track->getDefaultNumberOfLaps()); m_reversed.push_back(false); // This will be changed later in the code } } diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 7242d5419..90e7f74f1 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -135,7 +135,7 @@ Track::Track(const std::string &filename) m_ident=="overworld"; m_minimap_x_scale = 1.0f; m_minimap_y_scale = 1.0f; - m_default_number_of_laps= UserConfigParams::m_num_laps; + m_default_number_of_laps= 3; m_all_nodes.clear(); m_all_physics_only_nodes.clear(); m_all_cached_meshes.clear(); @@ -472,6 +472,7 @@ void Track::loadTrackInfo() root->get("groups", &m_groups); root->get("internal", &m_internal); root->get("reverse", &m_reverse_available); + root->get("default-number-of-laps",&m_default_number_of_laps); root->get("push-back", &m_enable_push_back); root->get("clouds", &m_clouds); root->get("bloom", &m_bloom); @@ -483,7 +484,6 @@ void Track::loadTrackInfo() root->get("caustics-speed", &m_caustics_speed); root->get("color-level-in", &m_color_inlevel); root->get("color-level-out", &m_color_outlevel); - root->get("default-number-of-laps",&m_default_number_of_laps); // Make the default for auto-rescue in battle mode and soccer mode to be false if(m_is_arena || m_is_soccer)