From 2975ea02aed12fa86dfe264665c3ee349d7bf7f7 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 3 Feb 2013 18:11:53 +0100 Subject: [PATCH] edit: Add remaining missing nation change reporting 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 --- src/lib/commands/edit.c | 9 ++++++++- tests/actofgod/journal.log | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 1de7ea46..edd8bc6f 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -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); diff --git a/tests/actofgod/journal.log b/tests/actofgod/journal.log index 932bd6b3..6febf338 100644 --- a/tests/actofgod/journal.log +++ b/tests/actofgod/journal.log @@ -1504,9 +1504,11 @@ 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 @@ -1595,15 +1597,19 @@ 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 @@ -1615,7 +1621,7 @@ Play#0 output Play#0 1 Technology : 0.00 Research : 0.00 Play#0 output Play#0 1 Education : 0.00 Happiness : 0.00 Play#0 output Play#0 1 Money : $ 0 - Play#0 output Play#0 1 Telegrams : 0 + Play#0 output Play#0 1 Telegrams : 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 @@ -1883,11 +1889,13 @@ 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