Permalink
Browse files

Fix for Glyph Building upgrades without a hall

  • Loading branch information...
1 parent e002146 commit 7ffa7cb3d5e558716ab054787fbcda0a1fba53de @icydee icydee committed Mar 23, 2013
@@ -41,10 +41,11 @@ before start_upgrade => sub {
my ($self, $cost) = @_;
my ($plans) = grep {$_->class eq 'Lacuna::DB::Result::Building::Permanent::HallsOfVrbansk'} @{$self->body->plan_cache};
- $self->body->delete_many_plans($plans, $self->level + 1);
+ if ($cost->{halls}) {
+ $self->body->delete_many_plans($plans, $cost->{halls});
+ }
};
-
use constant image => 'essentiavein';
sub image_level {
@@ -40,6 +40,7 @@ sub upgrade {
my $plan = $body->get_plan($building->class, $building->level + 1);
if (defined $plan) {
$body->delete_one_plan($plan);
+ $cost->{halls} = 0;
}
else {
$body->spend_water($cost->{water});
@@ -48,6 +49,7 @@ sub upgrade {
$body->spend_ore($cost->{ore});
$body->add_waste($cost->{waste});
$body->update;
+ $cost->{halls} = $building->level + 1;
}
$building->start_upgrade($cost);
@@ -27,7 +27,9 @@ before start_upgrade => sub {
my ($self, $cost) = @_;
my ($plans) = grep {$_->class eq 'Lacuna::DB::Result::Building::Permanent::HallsOfVrbansk'} @{$self->body->plan_cache};
- $self->body->delete_many_plans($plans, $self->level + 1);
+ if (defined $cost and $cost->{halls}) {
+ $self->body->delete_many_plans($plans, $cost->{halls});
+ }
};
1;
@@ -1,3 +1,6 @@
+3.0884:
+ - Fix: Bug when upgrading Glyph buildings, but with no hall plans
+
3.0883:
- Fix: Library timer was too excessive.
- Mod: Gradual increase in TM range from 465 to 900.

0 comments on commit 7ffa7cb

Please sign in to comment.