From c824e62695440768271dee5538124f1779d82f61 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Sun, 11 Nov 2012 15:18:03 -0700 Subject: [PATCH 1/2] Message failure fix. --- bin/tick_fissures.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/tick_fissures.pl b/bin/tick_fissures.pl index dae33430..f51d8b62 100644 --- a/bin/tick_fissures.pl +++ b/bin/tick_fissures.pl @@ -110,11 +110,13 @@ for my $body_id (sort keys %has_fissures) { my $now = DateTime->now; out(" Converted building ".$building->class." into a level $fissure_level Fissure!"); - $body->empire->send_predefined_message( - tags => ['Alert'], - filename => 'fissure_replaced_energy.txt', - params => [$body->name, $building->x,$building->y, $fissure_level], - ); + if ($body->empire_id) { + $body->empire->send_predefined_message( + tags => ['Alert'], + filename => 'fissure_replaced_energy.txt', + params => [$body->name, $building->x,$building->y, $fissure_level], + ); + } $building->update({ level => $fissure_level, class => 'Lacuna::DB::Result::Building::Permanent::Fissure', -- 2.51.2 From f53b1746a86b48e79071ec5d94f091af347ae005 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Mon, 12 Nov 2012 08:51:15 -0700 Subject: [PATCH 2/2] Better name for unhappy. --- lib/Lacuna/DB/Result/Map/Body.pm | 4 ++-- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 8 ++++---- var/upgrades/3.0873.sql | 4 ++-- var/www/public/changes.txt | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body.pm b/lib/Lacuna/DB/Result/Map/Body.pm index 99140822..d4ea7f44 100644 --- a/lib/Lacuna/DB/Result/Map/Body.pm +++ b/lib/Lacuna/DB/Result/Map/Body.pm @@ -126,8 +126,8 @@ __PACKAGE__->add_columns( plots_available => { data_type => 'tinyint', default_value => 0 }, surface_version => { data_type => 'tinyint', default_value => 0 }, max_berth => { data_type => 'tinyint', default_value => 1 }, - depression => { data_type => 'datetime', is_nullable => 0, set_on_create => 1 }, - depressed => { data_type => 'tinyint', default_value => 0 }, + unhappy_date => { data_type => 'datetime', is_nullable => 0, set_on_create => 1 }, + unhappy => { data_type => 'tinyint', default_value => 0 }, ); after 'sqlt_deploy_hook' => sub { diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 7cde8745..5ce28b76 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -1421,16 +1421,16 @@ sub tick_to { $self->last_tick($now); if ($self->happiness < 0) { $self->needs_recalc if ($self->happiness_hour < -20_000); - if ($self->depressed) { + if ($self->unhappy) { # Nothing for now... } else { - $self->depressed(1); - $self->depression($now); + $self->unhappy(1); + $self->unhappy_date($now); } } else { - $self->depressed(0); + $self->unhappy(0); } # Check to see if downward spiral still happening in happiness from negative plots. if ($self->needs_recalc) { diff --git a/var/upgrades/3.0873.sql b/var/upgrades/3.0873.sql index c1698f88..8237e915 100644 --- a/var/upgrades/3.0873.sql +++ b/var/upgrades/3.0873.sql @@ -1,3 +1,3 @@ -alter table body add column `depression` datetime NOT NULL default '2012-11-10 04:00:00'; -alter table body add column `depressed` tinyint(4) NOT NULL default 0; +alter table body add column `unhappy_date` datetime NOT NULL default '2012-11-10 04:00:00'; +alter table body add column `unhappy` tinyint(4) NOT NULL default 0; alter table spies add column `next_task` varchar(30) NOT NULL default 'Idle'; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index aa1baef4..a36244e2 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -13,6 +13,7 @@ - Add: Every occupied body that gets moved by a BHG generates an email. - Add: BHG calibrated to be able to change asteroid types. - Mod: "Stop Excavator Replace Alert" now also stops Excavator Deployed Alert. + - Fix: Updated resources.json 3.0872: - Fix: Spies need working infrastructure. -- 2.51.2