]> git.pond.sub.org Git - empserver/commitdiff
edit: Add remaining missing nation change reporting
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 3 Feb 2013 17:11:53 +0000 (18:11 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:02 +0000 (19:55 +0200)
Print a message describing the actual change for keys 't' (nat_tgms)
and 's' (nat_status).  The message is necessary to give the deity a
chance to catch unexpected changes, e.g. a player reading telegrams
just before the deity edits nat_tgms.

Send a bulletin to the country for key 's'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/journal.log

index 1de7ea46d47d52146538f576f1ea96f9246df6c0..edd8bc6fc04ff3e05c69733ec15da6e26d7d48af 100644 (file)
@@ -656,6 +656,9 @@ edit_nat(struct natstr *np, char *key, char *p)
        break;
     case 't':
        arg = LIMIT_TO(arg, 0, USHRT_MAX);
+       divine_nat_change_quiet(np, "Number of unread telegrams",
+                               arg != np->nat_tgms,
+                               "from %d to %d", np->nat_tgms, arg);
        np->nat_tgms = arg;
        break;
     case 'b':
@@ -709,7 +712,11 @@ edit_nat(struct natstr *np, char *key, char *p)
        np->nat_yorg = newy;
        break;
     case 's':
-       np->nat_stat = LIMIT_TO(arg, STAT_UNUSED, STAT_GOD);
+       arg = LIMIT_TO(arg, STAT_UNUSED, STAT_GOD);
+       divine_nat_change(np, "Status",
+                         (enum nat_status)arg != np->nat_stat,
+                         0, "to %s", nation_status[arg].name);
+       np->nat_stat = arg;
        break;
     case 'u':
        arg = LIMIT_TO(arg, 0, m_m_p_d * 60);
index 932bd6b39b62a916e7b189b567e29f030a555998..6febf33827e03adf3e06731213c8fcc084770ff2 100644 (file)
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 6 t -1
     Play#0 command edit
+    Play#0 output Play#0 1 Number of unread telegrams of 6 (#6) unchanged
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 7 t 65536
     Play#0 command edit
+    Play#0 output Play#0 1 Number of unread telegrams of 7 (#7) changed from 0 to 65535
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 1 T 3.14
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 6 s 0
     Play#0 command edit
+    Play#0 output Play#0 1 Status of 6 (#6) changed to unused
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 7 s -1
     Play#0 command edit
+    Play#0 output Play#0 1 Status of 7 (#7) changed to unused
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 4 s 5
     Play#0 command edit
+    Play#0 output Play#0 1 Status of 4 (#4) changed to deity
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 5 s 6
     Play#0 command edit
+    Play#0 output Play#0 1 Status of 5 (#5) changed to deity
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 5
     Play#0 command edit
     Play#0 output Play#0 1 Technology <T>: 0.00                Research <R>: 0.00
     Play#0 output Play#0 1 Education <E>: 0.00         Happiness <H>: 0.00
     Play#0 output Play#0 1 Money <M>: $     0
-    Play#0 output Play#0 1 Telegrams <t>:      0
+    Play#0 output Play#0 1 Telegrams <t>:      1
     Play#0 output Play#0 4 %c xxxxx -- thing value : 
     Play#0 input b 640
     Play#0 output Play#0 1 BTUs of 5 (#5) changed from 0 to 640
     Play#0 output Play#0 1 > BULLETIN from POGO, (#0)  dated Thu Jan  1 00:00:00 1970
     Play#0 output Play#0 1 BTUs changed from 0 to 640 by an act of POGO!
     Play#0 output Play#0 1 Number of seconds used changed from 0 to 86400 by an act of POGO!
+    Play#0 output Play#0 1 Status changed to deity by an act of POGO!
     Play#0 output Play#0 6 0 640
     Play#0 input read 5
     Play#0 command read
     Play#0 output Play#0 1 
     Play#0 output Play#0 1 > BULLETIN from POGO, (#0)  dated Thu Jan  1 00:00:00 1970
+    Play#0 output Play#0 1 Status changed to deity by an act of POGO!
     Play#0 output Play#0 1 BTUs changed from 0 to 640 by an act of POGO!
     Play#0 output Play#0 1 Technology changed from 0.00 to 1.00 by an act of POGO!
     Play#0 output Play#0 6 0 640