Permalink
Browse files

Make get_buildings show the highest level building by default

  • Loading branch information...
1 parent 4719f95 commit a578b7e78aacb7392232335b6268ffd39156deff T. Alexander Popiel committed Sep 20, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 get_buildings.pl
View
@@ -33,8 +33,10 @@
for my $building (@buildings) {
my $key = $building->{name};
$key .= " $building->{id}" if $key =~ $every;
- $buildings{$key} = $building->{id};
- $levels{$key} = $building->{level};
+ if (!$levels{$key} || $levels{$key} < $building->{level}) {
+ $buildings{$key} = $building->{id};
+ $levels{$key} = $building->{level};
+ }
}
for my $key (sort grep { /$name/ } keys %buildings) {
(my $name = $key) =~ s/ \Q$buildings{$key}\E\z//;

0 comments on commit a578b7e

Please sign in to comment.