DEADSOFTWARE

Supported non ascii system user names
[d2df-sdl.git] / src / game / g_options.pas
index 506fc186424753429b21151925830bb1a0b6376d..cc9a71400bc4a4a7cf159a0392e171f0c8c4cae8 100644 (file)
@@ -148,8 +148,12 @@ uses
   begin
     ASSERT(n >= 1);
     Result := GetUserName;
-    if Result = '' then Result := 'Player' + IntToStr(machine MOD 10000);
-    if n > 1 then Result := Copy(Result, 1, 10) + (' ' + IntToStr(n))
+    if Result = '' then
+      Result := 'Player' + IntToStr(machine MOD 10000);
+    if n = 1 then
+      Result := Copy(Result, 1, 12) + ' '
+    else
+      Result := Copy(Result, 1, 10) + ' ' + IntToStr(n)
   end;
 
 procedure g_Options_SetDefaultVideo;
@@ -966,6 +970,9 @@ begin
   config.WriteBool('Video', 'Fullscreen', gFullscreen);
   config.WriteBool('Video', 'Maximized', gWinMaximized);
 
+  config.WriteStr('Player1', 'Name', gPlayer1Settings.Name);
+  config.WriteStr('Player2', 'Name', gPlayer2Settings.Name);
+
   config.SaveFile(FileName);
   config.Free();
 end;