Fixed moveCompetitor not returning anything + signed/unsigned comparison warning

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3229 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 450a108ef559737805826abc1fe52809a7ee9ea4
Former-commit-id: ba031c7f05cfeb2dbd0d7b19137214d90a3f048c
This commit is contained in:
pouillot 2011-01-02 18:38:17 +00:00
parent 0c7157784f
commit 72887c9c3a

View file

@ -308,13 +308,15 @@ bool GfRace::moveCompetitor(GfDriver* pComp, int nDeltaPlace)
const int nNewIndex = (itComp - _pPrivate->vecCompetitors.begin()) + nDeltaPlace;
if (nNewIndex < 0)
itComp = _pPrivate->vecCompetitors.begin();
else if (nNewIndex >= _pPrivate->vecCompetitors.size())
else if (nNewIndex >= (int)_pPrivate->vecCompetitors.size())
itComp = _pPrivate->vecCompetitors.end();
else
itComp = _pPrivate->vecCompetitors.begin() + nNewIndex;
// Insert it at his new place.
_pPrivate->vecCompetitors.insert(itComp, pComp);
return true;
}