diff --git a/source/src/console.cpp b/source/src/console.cpp index a1a726f0..a9e27a7a 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -284,8 +284,6 @@ void keypress(int code, bool isdown, int cooked) { if(code==SDLK_RETURN) { - histpos = vhistory.length(); - string buf; // use a copy to safely close the commandline s_strcpy(buf, cmdline.buf); saycommand(NULL); @@ -298,6 +296,7 @@ void keypress(int code, bool isdown, int cooked) if(vhistory.empty() || strcmp(vhistory.last(), buf)) vhistory.add(newstring(buf)); // cap this? } + histpos = vhistory.length(); } else if(code==SDLK_ESCAPE) {