]> git.pond.sub.org Git - empserver/commit
edit &c: Add remaining missing sector change reporting
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 26 Jan 2013 10:45:18 +0000 (11:45 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:00 +0000 (19:55 +0200)
commit542a9ef83f3f593ca3195929a91b8c480f3079aa
tree3bb46844dd92ba7b7d3aaf62702430433fc2c0cb
parentfec5ad692dae7574810359e0cf59be3dd06683c2
edit &c: Add remaining missing sector change reporting

edit, setresource and setsector report change in three ways:

* Print a message.

* Send a bulletin to the changed object's owner.  This should be done
  if and only if the change is visible to the owner, e.g. in census or
  xdump.

* Report divine aid in news.  This should be done if and only if a
  bulletin was sent, except for changes that are neither negative nor
  positive, such as changing the distribution sector.

Fix the places that don't get it right for sectors:

    cmd  key    sctstr member   before  after   notes
    -------------------------------------------------
    edit l O    sct_oldown      --      B-
    edit l F    sct_fallout     --      BN      1
    edit l M    sct_mines       --      BN      2 3
    edit l D    sct_dist_x,y    --      B-      1
    edit l s    sct_type        --      B-      1
    edit l S    sct_newtype     --      B-      1
    setse ow    sct_own         B-      BN
    setse ol    sct_oldown      --      B-
    setse e     sct_effic       --      BN      2
    setse mo    sct_mobil       --      BN      2
    setse a     sct_avail       --      BN      2
    setse w     sct_work        --      BN      2

The two characters in columns before, after show whether the command
sends a bulletin (B) or not (-), and whether it reports news (N) or
not (-).

Notes:

1. Printed message massaged slightly for consistency with other keys.

2. Printed message improved to show the old value, too.  Necessary to
   give the deity a chance to catch unexpected changes, e.g. a player
   laying mines right before the deity edits them.  Watching out for
   such changes is especially important with non-interactive edit.

3. Bulletin and news suppressed for occupied sectors.

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