diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 46d8e64d0..ffa4380ca 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -3516,7 +3516,7 @@ void CGameContext::OnMapChange(char *pNewMapName, int MapNameSize) CLineReader LineReader; LineReader.Init(File); - array aLines; + std::vector vLines; char *pLine; int TotalLength = 0; while((pLine = LineReader.Get())) @@ -3524,19 +3524,19 @@ void CGameContext::OnMapChange(char *pNewMapName, int MapNameSize) int Length = str_length(pLine) + 1; char *pCopy = (char *)malloc(Length); mem_copy(pCopy, pLine, Length); - aLines.add(pCopy); + vLines.push_back(pCopy); TotalLength += Length; } io_close(File); char *pSettings = (char *)malloc(maximum(1, TotalLength)); int Offset = 0; - for(int i = 0; i < aLines.size(); i++) + for(auto &Line : vLines) { - int Length = str_length(aLines[i]) + 1; - mem_copy(pSettings + Offset, aLines[i], Length); + int Length = str_length(Line) + 1; + mem_copy(pSettings + Offset, Line, Length); Offset += Length; - free(aLines[i]); + free(Line); } CDataFileReader Reader;