From c1af6b2456f3313efcb4d40e3df2b628bfb4fae6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Sep 2009 23:44:49 +0100 Subject: [PATCH] Calculate total distance correctly --- yarrg/TODO | 2 -- yarrg/web/routetrade | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/yarrg/TODO b/yarrg/TODO index 055368f..6b227eb 100644 --- a/yarrg/TODO +++ b/yarrg/TODO @@ -25,8 +25,6 @@ DATABASE/DICTIONARY MANAGER WEBSITE ------- - route total leagues is wrong - multi-visit routes / circular routes adjustable potential cost of losses (rather than fixed diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 482c13a..7f7d27f 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -597,11 +597,11 @@ $addcols->({ Total => 0, DoReverse => 1 }, qw( % $iquery->execute($islandids[$i]); % my ($islandname) = $iquery->fetchrow_array(); -% my $this_dist= $distance->($islandids[$i-1],$islandids[$i]); -% $total_dist += $this_dist; % if (!$i) { Start at <% $islandname |h %> % } else { +% my $this_dist= $distance->($islandids[$i-1],$islandids[$i]); +% $total_dist += $this_dist; Sail to <% $islandname |h %> - <% $this_dist |h %> leagues % } -- 2.30.2