diff --git a/src/game/client/race.cpp b/src/game/client/race.cpp index 1ab7a0f41..e9593226c 100644 --- a/src/game/client/race.cpp +++ b/src/game/client/race.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -78,18 +78,21 @@ bool CRaceHelper::IsStart(CGameClient *pClient, vec2 Prev, vec2 Pos) { std::vector vIndices = pCollision->GetMapIndices(Prev, Pos); if(!vIndices.empty()) - for(int &Indice : vIndices) + { + for(const int Index : vIndices) { - if(pCollision->GetTileIndex(Indice) == TILE_START) + if(pCollision->GetTileIndex(Index) == TILE_START) return true; - if(pCollision->GetFTileIndex(Indice) == TILE_START) + if(pCollision->GetFTileIndex(Index) == TILE_START) return true; } + } else { - if(pCollision->GetTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_START) + const int Index = pCollision->GetPureMapIndex(Pos); + if(pCollision->GetTileIndex(Index) == TILE_START) return true; - if(pCollision->GetFTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_START) + if(pCollision->GetFTileIndex(Index) == TILE_START) return true; } }