From: mdw Date: Mon, 10 Mar 2003 23:37:49 +0000 (+0000) Subject: Fix nonexistent planet error. Make staying put cost nothing. X-Git-Tag: 1.1.2~6 X-Git-Url: https://git.distorted.org.uk/~mdw/rocl/commitdiff_plain/b496a5c1abe7e648f696efa684ebc444423a0110 Fix nonexistent planet error. Make staying put cost nothing. --- diff --git a/elite-salesman b/elite-salesman index 03dd4ee..bfc0f3e 100755 --- a/elite-salesman +++ b/elite-salesman @@ -1,6 +1,6 @@ #! /usr/bin/tclsh # -# $Id: elite-salesman,v 1.1 2003/03/07 00:45:51 mdw Exp $ +# $Id: elite-salesman,v 1.2 2003/03/10 23:37:49 mdw Exp $ package require "elite" "1.0.1" package require "vector" "1.0.0" @@ -75,8 +75,8 @@ if {[llength $argv] < 2} { set p [lindex $ww 0] } else { set p [parse-planet-spec $g [lindex $argv 1]] - if {[string equal $g ""]} { - puts stderr "$argv0: bad planet spec `$p'" + if {[string equal $p ""]} { + puts stderr "$argv0: bad planet spec `[lindex $argv 1]'" exit 1 } if {![in-galaxy-p $g $p]} { @@ -102,6 +102,7 @@ foreach {s x y} $ww { set j $index($ss) $av set $i $j [eval $weight [list $s $ss]] } + $av set $i $i 0 } destructure {lv pv} [graph-shortest-path $av] set i $index($p)