]> git.pond.sub.org Git - empserver/commitdiff
(opt_DEMANDUPDATE): Remove. Deities can use update_demandpolicy to
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Jul 2007 15:26:23 +0000 (15:26 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Jul 2007 15:26:23 +0000 (15:26 +0000)
control demand updates.

include/econfig-spec.h
src/lib/commands/upda.c
src/lib/commands/zdon.c
src/lib/common/wantupd.c
src/lib/global/options.c
src/lib/update/main.c

index 876125534d0ac95f249b44d10aeacdf62fcf354d..b9e645ee23c0077ceb7fd3e8b19a1e3edce37807 100644 (file)
@@ -161,8 +161,6 @@ EMPCF_OPT("BLITZ", opt_BLITZ,
     "Enable blitz mode")
 EMPCF_OPT("BRIDGETOWERS", opt_BRIDGETOWERS,
     "Allow bridge towers")
-EMPCF_OPT("DEMANDUPDATE", opt_DEMANDUPDATE,
-    "Allow demand updates")
 EMPCF_OPT("EASY_BRIDGES", opt_EASY_BRIDGES,
     "Allow bridge building without bridge heads")
 EMPCF_OPT("FALLOUT", opt_FALLOUT,
index f003546bf594ab5337fcfe624757eedd0f81ad8b..433ef4e5f124bf57dbce2c3511fe5d3615bb7104 100644 (file)
@@ -102,38 +102,38 @@ upda(void)
        next += update_window;
        pr("The next update window stops at %19.19s.\n", ctime(&next));
     }
-    if (opt_DEMANDUPDATE) {
-       if (update_demandpolicy != UDDEM_DISABLE) {
-           switch (update_demandpolicy) {
-           case UDDEM_TMCHECK:
-               next_update_check_time(&now, &next, &delta);
-               pr("Demand updates occur at update CHECK times.\n");
-               pr("The next update check is at %19.19s.\n",
-                  ctime(&next));
-               break;
-           case UDDEM_COMSET:
-               pr("Demand updates occur right after the demand is set.\n");
-               break;
-           default:
-               pr("Update demand policy is inconsistent.\n");
-           }
-       }
+
+    switch (update_demandpolicy) {
+    case UDDEM_TMCHECK:
+       next_update_check_time(&now, &next, &delta);
+       pr("Demand updates occur at update CHECK times.\n");
+       pr("The next update check is at %19.19s.\n",
+          ctime(&next));
+       break;
+    case UDDEM_COMSET:
+       pr("Demand updates occur right after the demand is set.\n");
+       break;
+    case UDDEM_DISABLE:
+       break;
+    default:
+       CANT_REACH();
+       pr("Update demand policy is inconsistent.\n");
     }
 
     if ((update_policy == UDP_TIMES) ||
-       ((update_demandpolicy == UDDEM_TMCHECK) && opt_DEMANDUPDATE)) {
+       (update_demandpolicy == UDDEM_TMCHECK)) {
        if (*update_times != 0)
            pr("The update schedule is: %s\n", update_times);
     }
-    if (opt_DEMANDUPDATE) {
-       if (update_demandpolicy != UDDEM_DISABLE) {
-           if (*update_demandtimes != 0)
-               pr("Demand updates are allowed during: %s\n",
-                  update_demandtimes);
-           pr("Demand updates require %d country(s) to want one.\n",
-              update_wantmin);
-       }
+
+    if (update_demandpolicy != UDDEM_DISABLE) {
+       if (*update_demandtimes != 0)
+           pr("Demand updates are allowed during: %s\n",
+              update_demandtimes);
+       pr("Demand updates require %d country(s) to want one.\n",
+          update_wantmin);
     }
+
     if (*game_days != 0)
        pr("Game days are: %s\n", game_days);
     if (*game_hours != 0)
index 6ceca9df7aef7c5df2588c97535f7cae74c2f845..3459c18fee3b4360bd4b090d7a8e3aa85c43c736 100644 (file)
@@ -54,6 +54,7 @@
 #include "commands.h"
 #include "optlist.h"
 #include "server.h"
+#include "wantupd.h"
 
 int
 zdon(void)
@@ -70,7 +71,7 @@ zdon(void)
     int dowant;
     char buf[1024];
 
-    if (!opt_DEMANDUPDATE) {
+    if (update_demandpolicy != UDDEM_DISABLE) {
        pr("Demand updates are not enabled.\n");
        return RET_FAIL;
     }
index 62628d0d2ccbdce7331eb27b5473085c512b4e3d..e1edfbb142b5ed369ed49a2826fc8db20eca28cf 100644 (file)
@@ -224,7 +224,7 @@ updatetime(time_t *now)
            return 1;
        }
     }
-    if (opt_DEMANDUPDATE) {
+    if (UDDEM_DISABLE != update_demandpolicy) {
        if (demand_check()) {
            logerror("Demand update, at check time.");
            return 1;
index 3951db764d25fe9aff4e3cec4c0e94bd0796cb96..9f50c0b8d7faaac941352d429d84167bec4f4b8c 100644 (file)
@@ -40,7 +40,6 @@ int opt_ALL_BLEED = 1;
 int opt_AUTO_POWER = 0;
 int opt_BLITZ = 1;
 int opt_BRIDGETOWERS = 1;
-int opt_DEMANDUPDATE = 1;
 int opt_EASY_BRIDGES = 1;
 int opt_FALLOUT = 1;
 int opt_FUEL = 0;
index 17042a617567bb8ba4bd28d803036dc2e52b0ffd..5bd1bd4c2b1ba8b08fceddbbddedcb2474e2b9e5 100644 (file)
@@ -41,6 +41,7 @@
 #include "player.h"
 #include "server.h"
 #include "update.h"
+#include "wantupd.h"
 
 long money[MAXNOC];
 long pops[MAXNOC];
@@ -158,7 +159,7 @@ update_main(void)
        mob_plane(etu);
        mob_land(etu);
     }
-    if (opt_DEMANDUPDATE)
+    if (update_demandpolicy != UDDEM_DISABLE)
        update_removewants();
     /* flush all mem file objects to disk */
     ef_flush(EF_NATION);