/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* zdon.c: Update right now
- *
+ *
* Known contributors to this file:
* Doug Hay, 1990
- * Markus Armbruster, 2007
+ * Markus Armbruster, 2007-2008
*/
/*
int
zdon(void)
{
- natid whichcnum;
+ int whichcnum;
struct natstr *natp;
char *p;
pr("Demand updates are not enabled.\n");
return RET_FAIL;
}
- whichcnum = player->cnum;
- p = NULL;
- if (player->god) {
- /* Deity syntax "country what" */
- whichcnum = onearg(player->argp[1], "Which country no.? ");
- if ((whichcnum > 0) && (getnatp(whichcnum)))
- p = getstarg(player->argp[2], "Want update? [Yes|No|Check] ",
- buf);
+ p = getstarg(player->argp[1], "Want update? [Yes|No|Check] ", buf);
+ if (!p)
+ return RET_SYN;
+ if (*p == 'y' || *p == 'Y') {
+ checking = 0;
+ wantupd = 1;
+ } else if (*p == 'n' || *p == 'N') {
+ checking = 0;
+ wantupd = 0;
} else {
- p = getstarg(player->argp[1], "Want update? [Yes|No|Check] ", buf);
+ checking = 1;
+ wantupd = 0;
}
- if (player->aborted)
- return RET_FAIL;
- checking = 1;
- wantupd = 0;
- if (p) {
- if (*p == 'y' || *p == 'Y') {
- checking = 0;
- wantupd = 1;
- } else if (*p == 'n' || *p == 'N') {
- checking = 0;
- wantupd = 0;
- }
- }
+ if (player->god) {
+ whichcnum = natarg(player->argp[2], "for which country? ");
+ if (whichcnum < 0)
+ return RET_SYN;
+ } else
+ whichcnum = player->cnum;
if (!(natp = getnatp(whichcnum))) {
pr("Unable to find country. %d\n", whichcnum);