]> git.pond.sub.org Git - empserver/commitdiff
sonar: Drop a redundant putship()
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 12 Jan 2015 21:13:36 +0000 (22:13 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:51 +0000 (08:20 +0100)
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 <armbru@pond.sub.org>
src/lib/commands/sona.c

index 2941cf1d24db150f4235a60f8dab69d5cfa5ef4d..0dc6a0814ecffe6adb06d35d3a8a7ebb7702d005 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Jim Griffith, 1989
  *     Ken Stevens, 1995
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2015
  */
 
 #include <config.h>
@@ -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;