Fixed warning

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5693 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-07-18 15:47:47 +00:00
parent c4797d6dd7
commit 2a4570f6c6

View File

@ -573,12 +573,13 @@ Kart *World::getPlayerKart(unsigned int n) const
Kart *World::getLocalPlayerKart(unsigned int n) const
{
int count=-1;
for(unsigned int i=0; i<m_karts.size(); i++)
const int kart_count = m_karts.size();
for(int i=0; i<kart_count; i++)
{
if(m_karts[i]->getCamera() && m_karts[i]->getController()->isPlayerController())
{
count++;
if(count==n) return m_karts[i];
if(count == (int)n) return m_karts[i];
}
}
return NULL;