From ab448f87675cc358daf57b0e52a1e3e65157f3f1 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 6 Apr 2008 02:13:07 +0000 Subject: [PATCH] histpos bug fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1733 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/console.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) {