From 964f55794c95bdcf47fc305c72db6817a08ea22d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 14 Jan 2014 23:26:06 +0100 Subject: [PATCH] edit: Fix reporting of no-op unit location change Report "unchanged" instead of "changed from X,Y to X,Y". Screwed up in v4.3.32. Signed-off-by: Markus Armbruster --- src/lib/commands/edit.c | 4 ++-- tests/actofgod/journal.log | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 41a450e7..17eaddc7 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -31,7 +31,7 @@ * Chad Zabel, 1994 * Steve McClure, 1998-2000 * Ron Koenderink, 2003-2009 - * Markus Armbruster, 2003-2013 + * Markus Armbruster, 2003-2014 */ #include @@ -798,7 +798,7 @@ edit_unit(struct empobj *unit, char *key, char *p, return RET_FAIL; } divine_unit_change_quiet(unit, "Location", - unit->own && unit->own != player->cnum, + newx != unit->x || newy != unit->y, "from %s to %s", xyas(unit->x, unit->y, player->cnum), xyas(newx, newy, player->cnum)); diff --git a/tests/actofgod/journal.log b/tests/actofgod/journal.log index ca9e92b7..0d1664cc 100644 --- a/tests/actofgod/journal.log +++ b/tests/actofgod/journal.log @@ -886,7 +886,7 @@ Play#0 output Play#0 6 0 640 Play#0 input edit s 3 L 1,-1 Play#0 command edit - Play#0 output Play#0 1 Location of cs cargo ship (#3) changed from 1,-1 to 1,-1 + Play#0 output Play#0 1 Location of cs cargo ship (#3) unchanged Play#0 output Play#0 6 0 640 Play#0 input edit p 0 @ 0 Play#0 command edit @@ -936,7 +936,7 @@ Play#0 output Play#0 6 0 640 Play#0 input edit p 3 l 1,-1 Play#0 command edit - Play#0 output Play#0 1 Location of f1 Sopwith Camel #3 changed from 1,-1 to 1,-1 + Play#0 output Play#0 1 Location of f1 Sopwith Camel #3 unchanged Play#0 output Play#0 6 0 640 Play#0 input edit u 0 @ 0 Play#0 command edit @@ -986,7 +986,7 @@ Play#0 output Play#0 6 0 640 Play#0 input edit u 3 L 1,-1 Play#0 command edit - Play#0 output Play#0 1 Location of sup supply #3 changed from 1,-1 to 1,-1 + Play#0 output Play#0 1 Location of sup supply #3 unchanged Play#0 output Play#0 6 0 640 Play#0 input edit n 0 @ 0 Play#0 command edit @@ -1036,7 +1036,7 @@ Play#0 output Play#0 6 0 640 Play#0 input edit n 3 L 1,-1 Play#0 command edit - Play#0 output Play#0 1 Location of 10kt fission warhead #3 changed from 1,-1 to 1,-1 + Play#0 output Play#0 1 Location of 10kt fission warhead #3 unchanged Play#0 output Play#0 6 0 640 Play#0 input edit s 6 t lc O 1 t lc t hc g 8 t lc Play#0 command edit