]> git.pond.sub.org Git - empserver/commitdiff
edit: Make edit l key 'L' preserve "no dist center"
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 18 Jan 2014 11:20:11 +0000 (12:20 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Feb 2014 12:19:24 +0000 (13:19 +0100)
Copying the sector copies its distribution center.  When the source
sector has none, the target sector is made to distribute to the
source.  Unexpected.  Zap the distribution center then.

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

index 2a959b4faaf6c85e86989032bcb71c2c2e81f0b7..8384f64eb68fb5ec15f95397b2880add38fe0b5d 100644 (file)
@@ -559,6 +559,11 @@ edit_sect(struct sctstr *sect, char *key, char *p)
                         newsect.sct_own);
        report_god_gives("Sector ", xyas(newx, newy, sect->sct_own),
                         sect->sct_own);
+       if (sect->sct_x == sect->sct_dist_x
+           && sect->sct_y == sect->sct_dist_y) {
+           sect->sct_dist_x = newx;
+           sect->sct_dist_y = newy;
+       }
        sect->sct_x = newx;
        sect->sct_y = newy;
        sect->sct_coastal = newsect.sct_coastal;
index d593eed7b922578ae8b2c4d0dcea345b16c1b205..371daa8177b8c6d63ec24389b9253758bf69bd2d 100644 (file)
@@ -110,7 +110,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
 0 -2 -8 4 0 0 0 0 0 0 0 0 0 -2 -8 0 0 0 1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 3 1 -7 4 0 0 0 0 0 0 0 0 0 1 -7 0 0 100 1 4 0 0 0 0 0 3 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 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