From 32b611eb8da85a30d00b7ef040bc5ebf85ae8ac9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Jan 2015 22:13:36 +0100 Subject: [PATCH] sonar: Drop a redundant putship() The old retreat_ship() took care not to put its ship argument (it still put other ships in a group retreat). Callers put it unconditionally to make the change to the ship permanent. The current retreat code puts all ships it changes, rendering sona()'s putship() redundant. Drop it. Signed-off-by: Markus Armbruster --- src/lib/commands/sona.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/commands/sona.c b/src/lib/commands/sona.c index 2941cf1d..0dc6a081 100644 --- a/src/lib/commands/sona.c +++ b/src/lib/commands/sona.c @@ -29,7 +29,7 @@ * Known contributors to this file: * Jim Griffith, 1989 * Ken Stevens, 1995 - * Markus Armbruster, 2004-2012 + * Markus Armbruster, 2004-2015 */ #include @@ -162,10 +162,8 @@ sona(void) "Sonar ping from %s detected by %s!\n", xyas(ship.shp_x, ship.shp_y, targ.shp_own), prship(&targ)); - if (targ.shp_rflags & RET_SONARED) { + if (targ.shp_rflags & RET_SONARED) retreat_ship(&targ, targ.shp_own, 's'); - putship(targ.shp_uid, &targ); - } } if (dist > vrange) continue;