Fixed bug in save replay menu

This commit is contained in:
jsalmon3 2003-02-28 03:16:35 +00:00
parent e2766a38e2
commit 7cd577a861
3 changed files with 18 additions and 1 deletions

View file

@ -895,7 +895,6 @@
<LI>Fixed bug #575614: Holy Vision broken when fog of war off (from
Jimmy Salmon).
</UL>
<A NAME="current"> </A>
<P><LI>Version 1.18
<UL>
<LI><B>1.18pre1</B>
@ -1096,6 +1095,9 @@
Smith).
<LI>Added ctrl-v for pasting, ctrl-u to delete everything, fixed several
bugs in input boxes (from Jimmy Salmon).
<A NAME="current"> </A>
<LI><B>1.18pre2</B>
<LI>Fixed bug in save replay menu (from Jimmy Salmon).
<LI>+++
</UL>
</UL>

View file

@ -827,6 +827,7 @@ global void GameMainLoop(void)
VideoSyncSpeed = RealVideoSyncSpeed;
}
NetworkQuit();
EndReplayLog();
if( GameResult==GameDefeat ) {
fprintf(stderr,"You have lost!\n");
SetStatusLine("You have lost!");

View file

@ -2321,6 +2321,15 @@ local void SaveReplayOk(void)
menu = FindMenu("menu-save-replay");
if (strchr(menu->items[1].d.input.buffer, '/')) {
ErrorMenu("Name cannot contain '/'");
return;
}
if (strchr(menu->items[1].d.input.buffer, '\\')) {
ErrorMenu("Name cannot contain '\\'");
return;
}
#ifdef WIN32
sprintf(TempPathBuf, "logs/");
#else
@ -2343,6 +2352,11 @@ local void SaveReplayOk(void)
}
fd = fopen(TempPathBuf, "wb");
if (!fd) {
ErrorMenu("Cannot write to file");
free(buf);
return;
}
fwrite(buf, s.st_size, 1, fd);
fclose(fd);