diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 120948f3..4e2717a8 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -1317,7 +1317,7 @@ sub prevent_insurrection { my ($self, $defender) = @_; return $self->get_spooked->id unless (defined $defender); $self->on_body->add_news(50,'Officials prevented a coup d\'�tat today on on %s by capturing %s and comrades.', $self->on_body->name, $self->name); - $defender->capture_a_spy($self)->id; + $self->go_to_jail; my $alliance_id = $defender->empire->alliance_id; if ($alliance_id) { my @member_ids = $defender->empire->alliance->members->get_column('id')->all; @@ -1325,14 +1325,20 @@ sub prevent_insurrection { my $count = randint(5,15); while (my $conspirator = $conspirators->next ) { $count--; - $defender->capture_a_spy($conspirator); + $conspirator->go_to_jail; + $conspirator->update; last if $count < 1; } } - return $defender->on_body->empire->send_predefined_message( + $defender->on_body->empire->send_predefined_message( tags => ['Alert'], filename => 'prevented_insurrection.txt', params => [$self->on_body_id, $self->on_body->name, $defender->format_from], + ); + $self->empire->send_predefined_message( + tags => ['Alert'], + filename => 'insurrection_attempt_failed.txt', + params => [$self->on_body_id, $self->on_body->name, $self->format_from], )->id; } diff --git a/var/messages/insurrection_attempt_failed.txt b/var/messages/insurrection_attempt_failed.txt new file mode 100644 index 00000000..1f3e8f39 --- /dev/null +++ b/var/messages/insurrection_attempt_failed.txt @@ -0,0 +1,8 @@ +Insurrection Failed +~~~ +Our insurrection on {Planet %s %s} was prevented by enemy agents and I was captured. I'm lucky to have gotten this message out to you. + +Regards, + +%s + diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 7050c044..eb7e19ff 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -25,6 +25,7 @@ - Fix: Ore production calculation bug when mining ministries are used. - Fix: Change in population not being tracked by stats, which caused fastest growing medal to be handed out incorrectly. - Fix: Spy mission counts weren't being tallied correctly, which was affecting medals and stats. + - Fix: Messages coming from wrong spy to wrong empire for insurrection. 2.4301 - Fixed counter intel reports being signed by wrong agent.