From e604c6e7374817a0419ef9015e9a0eb9d57a9ff4 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 18 Jan 2014 12:20:11 +0100 Subject: [PATCH] edit: Make edit l key 'L' preserve "no dist center" 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 --- src/lib/commands/edit.c | 5 +++++ tests/actofgod/final.xdump | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 2a959b4f..8384f64e 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -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; diff --git a/tests/actofgod/final.xdump b/tests/actofgod/final.xdump index d593eed7..371daa81 100644 --- a/tests/actofgod/final.xdump +++ b/tests/actofgod/final.xdump @@ -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 3 3 -7 4 0 0 0 0 0 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