diff --git a/bin/puppet/setup_colony.pl b/bin/puppet/setup_colony.pl index 68efc5c6..b8d2c32d 100755 --- a/bin/puppet/setup_colony.pl +++ b/bin/puppet/setup_colony.pl @@ -41,6 +41,8 @@ our $quiet; } print "Really!\n"; if ($sanitize) { + my @all_buildings = @{$body->building_cache}; + $body->delete_buildings(\@all_buildings); $body->sanitize; } print "Checking empire\n"; diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index 63a34ef0..ad3daa19 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -436,7 +436,10 @@ sub send { my $end_range = DateTime->now->add(seconds => ($seconds2arrive + $sec_rng)); my $ships_rs; my $ag_chk = 0; - if ( grep { $self->type eq $_ } @ag_list ) { + if ($target->isa('Lacuna::DB::Result::Map::Star')) { + $ag_chk = 0; #Just an empty statement. + } + elsif ( grep { $self->type eq $_ } @ag_list ) { $ships_rs = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search({ id => { '!=' => $self->id }, body_id => $self->body_id, diff --git a/lib/Lacuna/DB/Result/Ships/AttackGroup.pm b/lib/Lacuna/DB/Result/Ships/AttackGroup.pm index 2aa9064e..cdd9c931 100644 --- a/lib/Lacuna/DB/Result/Ships/AttackGroup.pm +++ b/lib/Lacuna/DB/Result/Ships/AttackGroup.pm @@ -25,6 +25,7 @@ with "Lacuna::Role::Ship::Arrive::DeployBleeder"; with "Lacuna::Role::Ship::Arrive::DeploySmolderingCrater"; with "Lacuna::Role::Ship::Arrive::ScanSurface"; with "Lacuna::Role::Ship::Arrive::SurveySurface"; +with "Lacuna::Role::Ship::Arrive::DestroyMinersExcavators"; with "Lacuna::Role::Ship::Arrive::GroupHome"; no Moose; diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 85bbe54e..c3811794 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -380,6 +380,7 @@ sub send_ship_types { number_of_docks => 0, }; my $payload; + $ag_chk = 0 if ($target->isa('Lacuna::DB::Result::Map::Star')); foreach my $ship (values %$ship_ref) { if ($ag_chk > 1 and grep { $ship->type eq $_ } @ag_list) { diff --git a/lib/Lacuna/Role/Ship/Arrive/DestroyMinersExcavators.pm b/lib/Lacuna/Role/Ship/Arrive/DestroyMinersExcavators.pm index 2e5d1951..57e5b31a 100644 --- a/lib/Lacuna/Role/Ship/Arrive/DestroyMinersExcavators.pm +++ b/lib/Lacuna/Role/Ship/Arrive/DestroyMinersExcavators.pm @@ -14,6 +14,32 @@ after handle_arrival_procedures => sub { my $is_uninhabit = ($body_attacked->isa('Lacuna::DB::Result::Map::Body::Planet') and !(defined($body_attacked->empire_id)) ); # not an asteroid or uninhabited planet return unless ( $self->foreign_body_id && ($is_asteroid || $is_uninhabit)); + my $do_boom = 0; + my $done_after = 1; + if ($self->type eq "attack_group") { + my $payload = $self->payload; + my @trim; + for my $fleet (keys %{$payload->{fleet}}) { + if ($payload->{fleet}->{$fleet}->{type} eq "detonators") { + $do_boom = 1; + push @trim, $fleet; + } + else { + $done_after = 0; + } + } + if ($done_after == 0 and $do_scan) { + for my $key (@trim) { + delete $payload->{fleet}->{$key}; + } + $self->payload($payload); + $self->update; + } + } + else { + $do_boom = 1; + } + return unless $do_boom; my $logs = Lacuna->db->resultset('Lacuna::DB::Result::Log::Battles'); my $mcount = 0; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 509ba32b..d4670854 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -3,7 +3,8 @@ - Add: view_unread Inbox API - Add: Stations auto-seize - Add: Voting allowed in embassy - - Fix: Detonators do not group when sent toward different stars. + - Fix: If star is a target, no grouping. + - Fix: Detonators work properly on arrival. 3.0909: - Add: Admin UI to set alliance logo.