#! /usr/bin/tclsh
#
-# $Id: elite-map,v 1.3 2003/02/26 01:12:57 mdw Exp $
+# $Id: elite-map,v 1.4 2003/03/07 00:41:46 mdw Exp $
package require "elite" "1.0.0"
set out [format "%2s %s" $sy [world-summary $s]]
if {[llength $n]} {
append out [format " (%.1f LY)" \
- [expr {[world-distance $p(x) $p(y) $pp(x) $pp(y)]/10.0}]]
+ [expr {[elite-distance $p(x) $p(y) $pp(x) $pp(y)]/10.0}]]
}
puts $out
}
}
"-d" {
incr i
- set d [expr {[lindex $argv $i] * 10}]
+ set d [expr {int([lindex $argv $i] * 10)}]
}
"-W" {
incr i
}
set p [lrange $argv $i end]
-set ww [worldinfo $g]
+set ww [elite-galaxylist $g]
if {![llength $p]} {
set n {}
set rt {}
set w $ww
incr v -1
} else {
- if {![string equal $weight ""]} {
- puts -nonewline stderr "\[computing adjacency table..."
- adjacency $ww adj
- puts stderr " done\]"
- }
+ if {![string equal $weight ""]} { elite-adjacency adj $ww $d }
set n {}
foreach a $p {
set s [parse-planet-spec $g $a]
foreach w [lrange $n 1 end] {
destructure {p .} [shortest-path adj $home $w $weight]
if {![llength $p]} {
- puts -stderr \
- "$argv0: no route from [worldinfo $home] to [worldinfo $w]"
+ puts stderr \
+ "$argv0: no route from [worldname $home] to [worldname $w]"
exit 1
}
eval lappend rt $p