From 69c6e63249a4629130e9563f4a32513b424f5d33 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 20 Aug 2021 10:41:03 -0500 Subject: [PATCH] Fixed console variables crash. Signed-off-by: Chris Galvan --- Code/Legacy/CrySystem/XConsole.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/Legacy/CrySystem/XConsole.cpp b/Code/Legacy/CrySystem/XConsole.cpp index 2293352f7e..46eea1528c 100644 --- a/Code/Legacy/CrySystem/XConsole.cpp +++ b/Code/Legacy/CrySystem/XConsole.cpp @@ -3133,6 +3133,9 @@ char* CXConsole::GetCheatVarAt(uint32 nOffset) ////////////////////////////////////////////////////////////////////////// size_t CXConsole::GetSortedVars(AZStd::vector& pszArray, const char* szPrefix) { + // This method used to insert instead of push_back, so we need to clear first + pszArray.clear(); + size_t iPrefixLen = szPrefix ? strlen(szPrefix) : 0; // variables