Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed errors with Building Roles

  • Loading branch information...
commit 389af2567e27b586b4c6f610c0da0112d56d1be7 1 parent aac160a
@icydee icydee authored
View
8 lib/Lacuna/Role/Building/CantBuildWithoutPlan.pm
@@ -3,9 +3,11 @@ package Lacuna::Role::Building::CantBuildWithoutPlan;
use Moose::Role;
around can_build => sub {
- my ($orig, $self, $body) = @_;
- if ($body->get_plan(__PACKAGE__, 1)) {
- return $orig->($self, $body);
+ my $orig = shift;
+ my $self = shift;
+
+ if ($self->body->get_plan(ref $self, 1)) {
+ return $self->$orig(@_);
}
confess [1013,"You can't build ".$self->name.", unless you have a plan."];
};
View
4 lib/Lacuna/Role/Building/UpgradeWithHalls.pm
@@ -9,8 +9,8 @@ around can_upgrade => sub {
my $self = shift;
my $body = $self->body;
- if ($body->get_plan(__PACKAGE__, $self->level + 1)) {
- return $orig->$self(@_);
+ if ($body->get_plan(ref $self, $self->level + 1)) {
+ return $self->$orig(@_);
}
# Do we have enough hall (plans) to upgrade?
Please sign in to comment.
Something went wrong with that request. Please try again.