hedgewars/uConsole.pas
changeset 1242 4aca5f7b2504
parent 1066 1f1b3686a2b0
child 1277 752b53481057
--- a/hedgewars/uConsole.pas	Sun Aug 31 16:27:47 2008 +0000
+++ b/hedgewars/uConsole.pas	Sun Aug 31 17:22:50 2008 +0000
@@ -200,9 +200,18 @@
 end;
 
 function GetLastConsoleLine: shortstring;
+var Result: shortstring;
+	i: LongWord;
 begin
-if CurrLine = 0 then GetLastConsoleLine:= ConsoleLines[Pred(cLinesCount)].s
-                else GetLastConsoleLine:= ConsoleLines[Pred(CurrLine)].s
+i:= (CurrLine + cLinesCount - 2) mod cLinesCount;
+Result:= ConsoleLines[i].s;
+
+//Result:= Result + #10;
+
+i:= (CurrLine + cLinesCount - 1) mod cLinesCount;
+Result:= Result + ConsoleLines[i].s;
+
+GetLastConsoleLine:= Result
 end;
 
 procedure StopMessages(Message: Longword);
@@ -236,6 +245,7 @@
 RegisterVariable('grave'   , vtCommand, @chGrave        , false);
 RegisterVariable('bind'    , vtCommand, @chBind         , true );
 RegisterVariable('addhh'   , vtCommand, @chAddHH        , false);
+RegisterVariable('hat'     , vtCommand, @chSetHat       , false);
 RegisterVariable('hhcoords', vtCommand, @chSetHHCoords  , false);
 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false);
 RegisterVariable('quit'    , vtCommand, @chQuit         , true );