From 952e4629d820dee2191f71e69ef8d8bbdfa7e835 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 26 Sep 2007 06:28:19 +0000 Subject: [PATCH] Removed compiler warning, fixed usage of '-1' as number of karts (meaning maximum number of karts). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1263 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/main.cpp | 1 + src/race_manager.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index df7d25902..187f99a99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -178,6 +178,7 @@ int handleCmdLine(int argc, char **argv) } race_manager->setNumKarts(user_config->m_karts ); fprintf ( stdout, _("%d karts will be used.\n"), user_config->m_karts); + i++; } else if( !strcmp(argv[i], "--list-tracks") || !strcmp(argv[i], "-l") ) { diff --git a/src/race_manager.cpp b/src/race_manager.cpp index 501a3e14a..872d50481 100644 --- a/src/race_manager.cpp +++ b/src/race_manager.cpp @@ -66,8 +66,8 @@ GrandPrixMode::GrandPrixMode(const std::vector& players_, std::vector kart_names; - if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; - if(m_num_karts < m_players.size()) m_num_karts = m_players.size(); + if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; + if((unsigned int)m_num_karts < m_players.size()) m_num_karts = m_players.size(); kart_names.resize(m_num_karts); @@ -164,8 +164,8 @@ QuickRaceMode::QuickRaceMode(const std::string& track_, : m_track(track_), m_players(players_), m_difficulty(difficulty_), m_num_karts(numKarts_), m_num_laps(numLaps_) { - if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; - if(m_num_karts < m_players.size()) m_num_karts = m_players.size(); + if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; + if((unsigned int)m_num_karts < m_players.size()) m_num_karts = m_players.size(); } //-----------------------------------------------------------------------------