Permalink
Browse files

Merge branch 'develop' of github.com:lemming552/Lacuna-Server-Open in…

…to develop
  • Loading branch information...
2 parents 750b81c + 7e5ae0d commit 9be0461140b71390beb5bbd086d8a7c2ef2c17ab @lemming552 lemming552 committed Mar 10, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Lacuna/RPC/Building/HallsOfVrbansk.pm
@@ -96,7 +96,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) {

0 comments on commit 9be0461

Please sign in to comment.