Store game down flag in the game table
This avoids the silly opening of downfil all the time. For what it's worth, it also makes the information visible in xdump, as new game selector down.
This commit is contained in:
parent
f1d89514a5
commit
fe9f02ccfb
5 changed files with 36 additions and 2 deletions
|
@ -40,6 +40,7 @@
|
|||
#include "com.h"
|
||||
#include "empio.h"
|
||||
#include "file.h"
|
||||
#include "game.h"
|
||||
#include "match.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
|
@ -187,8 +188,13 @@ gamedown(int suppress_deity_message)
|
|||
struct telstr tgm;
|
||||
char buf[MAXTELSIZE + 1]; /* UTF-8 */
|
||||
|
||||
if ((down_fp = fopen(downfil, "rb")) == NULL)
|
||||
if (!game_play_disabled())
|
||||
return 0;
|
||||
|
||||
if ((down_fp = fopen(downfil, "rb")) == NULL) {
|
||||
logerror("Could not open downfil.\n");
|
||||
return 1;
|
||||
}
|
||||
if (fread(&tgm, sizeof(tgm), 1, down_fp) != 1) {
|
||||
logerror("bad header on login message (downfil)");
|
||||
fclose(down_fp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue