From c45748224afddc0c48c47c33a25bdba6f50fd9be Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 9 May 2012 14:45:29 -0600 Subject: [PATCH] Distance number is 100 times further as returned. --- lib/Lacuna/Role/Ship/Send/Range.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/Role/Ship/Send/Range.pm b/lib/Lacuna/Role/Ship/Send/Range.pm index bf0dc132..21188f1f 100644 --- a/lib/Lacuna/Role/Ship/Send/Range.pm +++ b/lib/Lacuna/Role/Ship/Send/Range.pm @@ -6,9 +6,12 @@ use Moose::Role; after can_send_to_target => sub { my ($self, $target) = @_; - my $distance = int($self->body->calculate_distance_to_target($target) +0.5); - my $range = int($self->speed/100+0.5); + my $distance = $self->body->calculate_distance_to_target($target); + my $range = $self->speed; +# Note that $distance is actually *100 further, so we'll divide before output if needed. if ($distance > $range) { + $distance = int($distance/100+0.5); + $range = int($range/100+0.5); confess [1009, 'You only have a range of '.$range.' with this ship. This body is '.$distance.' away.']; } }; -- 2.51.2