Store update disable flag in the game table to make it visible in
xdump: (gamestr): New member game_upd_disable. (game_ca): Update accordingly. (game_ctrl_update): New. (disa, enab): Use it. (updates_disabled): Rewrite and move to game.c (disablefil): Remove.
This commit is contained in:
parent
e7e8717e86
commit
286dda725e
8 changed files with 31 additions and 34 deletions
|
@ -33,25 +33,13 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
#include "game.h"
|
||||
|
||||
int
|
||||
disa(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if ((fd = open(disablefil, O_RDWR | O_CREAT | O_TRUNC, S_IRWUG)) < 0)
|
||||
return RET_FAIL;
|
||||
close(fd);
|
||||
game_ctrl_update(0);
|
||||
pr("Updates are disabled\n");
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
|
@ -33,18 +33,13 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#elif defined(__GNUC__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
#include "game.h"
|
||||
|
||||
int
|
||||
enab(void)
|
||||
{
|
||||
(void)unlink(disablefil);
|
||||
game_ctrl_update(1);
|
||||
pr("Updates are enabled\n");
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue