From 54e4708484ff8e8234cc0d32c1581a1a6e1e1aa5 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Fri, 5 Jan 2024 01:29:23 -0600 Subject: [PATCH] Minor enhancement to location processing --- wiki-map.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wiki-map.pl b/wiki-map.pl index 463e731..499a6ba 100644 --- a/wiki-map.pl +++ b/wiki-map.pl @@ -168,12 +168,16 @@ foreach my $page (values %{$location_query_results->{query}{pages}}) my $region_name = $parsed_template->{positional_params}[1]; $regions_by_subregion{$location->{name}} = $region_name; - push @location_continuations, sub + next unless $parsed_template->{positional_params}[0] =~ $coords_regex; + my ($nw, $sw) = ($1, $2); + $location->make_tile_at($nw, $sw); + + if($regiondir) { - return unless $parsed_template->{positional_params}[0] =~ $coords_regex; - my ($nw, $sw) = ($1, $2); - $location->make_tile_at($nw, $sw); - if($regiondir) + # Locations can have their own images rendered, given a list of context tiles + # To reference these tiles, they must exist in the parent grid, + # so the remainder of the processing must happen after the region tile pages are processed + push @location_continuations, sub { my @coords_list = ({ nw => $nw, sw => $sw}); foreach my $coords (split /;/, $parsed_template->{named_params}{context_tiles})