chiark / gitweb /
And then screwed the code over...
[rocl] / elite-map
index 72f3a8595707d8d67926186759f5cd45515d78a0..61eea9ed0e0193485acb029e5d7b2f5b869c012b 100755 (executable)
--- a/elite-map
+++ b/elite-map
@@ -1,6 +1,6 @@
 #! /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"
 
@@ -109,7 +109,7 @@ proc show-key {l {n {}}} {
     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
   }
@@ -138,7 +138,7 @@ for {set i 0} {$i < [llength $argv]} {incr i} {
     }
     "-d" {
       incr i
-      set d [expr {[lindex $argv $i] * 10}]
+      set d [expr {int([lindex $argv $i] * 10)}]
     }
     "-W" {
       incr i
@@ -182,18 +182,14 @@ for {set i 0} {$i < [llength $argv]} {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]
@@ -209,8 +205,8 @@ if {![llength $p]} {
     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