From 72887c9c3ae64799db64438600daf58c74587d10 Mon Sep 17 00:00:00 2001 From: pouillot Date: Sun, 2 Jan 2011 18:38:17 +0000 Subject: [PATCH] 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 --- src/libs/tgfdata/race.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/tgfdata/race.cpp b/src/libs/tgfdata/race.cpp index 371f948a..526269ec 100644 --- a/src/libs/tgfdata/race.cpp +++ b/src/libs/tgfdata/race.cpp @@ -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; }