diff --git a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm index 563e7794..a46acbdf 100644 --- a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm +++ b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm @@ -22,6 +22,7 @@ use constant type_formatted => 'Space Station Hull'; with "Lacuna::Role::Ship::Send::Planet"; with 'Lacuna::Role::Ship::Send::Uninhabited'; +with 'Lacuna::Role::Ship::Send::MemberOfAlliance'; with "Lacuna::Role::Ship::Send::SpendNextColonyCost"; with "Lacuna::Role::Ship::Arrive::ConvertToStation"; diff --git a/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm b/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm new file mode 100644 index 00000000..bc09a064 --- /dev/null +++ b/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm @@ -0,0 +1,11 @@ +package Lacuna::Role::Ship::Send::MemberOfAlliance; + +use strict; +use Moose::Role; + +after can_send_to_target => sub { + my ($self, $target) = @_; + confess [1013, 'You must be part of an alliance.'] unless ($self->body->empire->alliance_id); +}; + +1;