diff --git a/lib/Lacuna/RPC/Building/HallsOfVrbansk.pm b/lib/Lacuna/RPC/Building/HallsOfVrbansk.pm index d420ab2e8..9fb393ff5 100644 --- a/lib/Lacuna/RPC/Building/HallsOfVrbansk.pm +++ b/lib/Lacuna/RPC/Building/HallsOfVrbansk.pm @@ -95,7 +95,11 @@ sub sacrifice_to_upgrade { if ($total < $needed) { confess [1009, 'The Halls of Vrbansk do not have the knowledge necessary to upgrade the '.$upgrade->name]; } - shift @halls if ($total > $needed); # Leave one hall standing if not needed for upgrade. + # Leave one hall standing if not needed for upgrade. + if ($total > $needed) { + @halls = sort { ($a->id != $building_id) <=> ($b->id != $building_id) } @halls; + shift(@halls); + } while ($needed) { my $hall = shift(@halls); if ($hall) {