From 962799ec7e4a3e5533fd1b4abc0a9e812e08ce44 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Thu, 3 Dec 2015 15:38:38 -0700 Subject: [PATCH] Delete Excavator sites on flip. --- lib/Lacuna.pm | 2 +- lib/Lacuna/DB/Result/Spies.pm | 3 +++ var/www/public/changes.txt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index 26889837..30a0e144 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0916; +our $VERSION = 3.0917; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index d8488300..842f6bb9 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -1971,6 +1971,9 @@ sub steal_planet { $trade->withdraw; } } + # Remove all Excavator outposts from planet + Lacuna->db->resultset('Excavators') + ->search({planet_id => $self->on_body->id})->delete_all; # Remove Supply chains to and from planet foreach my $chain ($self->on_body->out_supply_chains) { $chain->delete; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 1ff8acd9..98b4271d 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -2,6 +2,7 @@ - Fix: Recalc stats when building 1+x plans. - Fix: Station incoming shows your incoming as own, not station owner's incoming. - Fix: Better input validation for fleet. + - Fix: On flip, remove any excavator sites. 3.0916: - Mod: Jackpot enhanced. -- 2.51.2