Fixed bug in save replay menu
This commit is contained in:
parent
e2766a38e2
commit
7cd577a861
3 changed files with 18 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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!");
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue