fix issue #6 (missing nick in chat)
authorkoda
Sat, 31 Jul 2010 07:05:06 +0200
changeset 3676 fa29572fa56a
parent 3674 10f3099b497c
child 3678 00428183300f
fix issue #6 (missing nick in chat)
hedgewars/uChat.pas
hedgewars/uIO.pas
hedgewars/uMisc.pas
--- a/hedgewars/uChat.pas	Sun Jul 25 17:32:07 2010 +0200
+++ b/hedgewars/uChat.pas	Sat Jul 31 07:05:06 2010 +0200
@@ -29,7 +29,7 @@
 procedure DrawChat;
 procedure KeyPressChat(Key: Longword);
 
-var UserNick: shortstring;
+var UserNick: shortstring = '';
     ChatReady: boolean;
     showAll: boolean;
 
@@ -316,7 +316,6 @@
 begin
     lastStr:= 0;
     visibleCount:= 0;
-    UserNick:= '';
     showAll:= false;
     ChatReady:= false;
     missedCount:= 0;
@@ -324,7 +323,7 @@
 
 procedure freeModule;
 begin
-
+    UserNick:= '';
 end;
 
 end.
--- a/hedgewars/uIO.pas	Sun Jul 25 17:32:07 2010 +0200
+++ b/hedgewars/uIO.pas	Sat Jul 31 07:05:06 2010 +0200
@@ -366,7 +366,6 @@
 procedure freeModule;
 begin
     ipcPort:= 0;
-
 end;
 
 end.
--- a/hedgewars/uMisc.pas	Sun Jul 25 17:32:07 2010 +0200
+++ b/hedgewars/uMisc.pas	Sat Jul 31 07:05:06 2010 +0200
@@ -87,7 +87,7 @@
     cShowFPS        : boolean = false;
     cAltDamage      : boolean = true;
     cReducedQuality : LongInt = rqNone;
-
+    //userNick is in uChat
     recordFileName  : shortstring = '';
     
     cCaseFactor     : Longword;
@@ -795,6 +795,25 @@
     flush(f);
     close(f);
 {$ENDIF}
+
+    // re-init flags so they'll always contain safe values
+    cScreenWidth    := 1024;
+    cScreenHeight   := 768;
+    cBits           := 32;
+    cBitsStr        := '32';
+    //ipcPort is in uIO
+    cFullScreen     := false;
+    isSoundEnabled  := true;
+    isMusicEnabled  := false;
+    cLocaleFName    := 'en.txt';
+    cInitVolume     := 50;
+    cTimerInterval  := 8;
+    //pathPrefix is in uConsts
+    cShowFPS        := false;
+    cAltDamage      := true;
+    cReducedQuality := rqNone;
+    //userNick is in uChat
+    recordFileName  := '';
 end;
 
 end.