diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index 46660eb3..53618b8f 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -56,6 +56,9 @@ sub max_ships { sub can_build_ship { my ($self, $ship, $costs) = @_; + if (ref $ship eq 'Lacuna::DB::Result::Ships') { + confess [1002, 'That is an unknown ship type.']; + } $ship->shipyard_id($self->id); my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships'); $costs ||= $self->get_ship_costs($ship); diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index d26be506..46d8b16c 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -43,7 +43,7 @@ __PACKAGE__->typecast_map(type => { 'scow' => 'Lacuna::DB::Result::Ships::Scow', 'freighter' => 'Lacuna::DB::Result::Ships::Freighter', 'dory' => 'Lacuna::DB::Result::Ships::Dory', - 'bomber' => 'Lacuna::DB::Result::Ships::Bomber', + 'snark' => 'Lacuna::DB::Result::Ships::Snark', 'spy_shuttle' => 'Lacuna::DB::Result::Ships::SpyShuttle', 'drone' => 'Lacuna::DB::Result::Ships::Drone', 'fighter' => 'Lacuna::DB::Result::Ships::Fighter', diff --git a/lib/Lacuna/DB/Result/Ships/Bomber.pm b/lib/Lacuna/DB/Result/Ships/Snark.pm similarity index 96% rename from lib/Lacuna/DB/Result/Ships/Bomber.pm rename to lib/Lacuna/DB/Result/Ships/Snark.pm index 31609955..1500d9bd 100644 --- a/lib/Lacuna/DB/Result/Ships/Bomber.pm +++ b/lib/Lacuna/DB/Result/Ships/Snark.pm @@ -1,4 +1,4 @@ -package Lacuna::DB::Result::Ships::Bomber; +package Lacuna::DB::Result::Ships::Snark; use Moose; no warnings qw(uninitialized); diff --git a/var/upgrades/2.2100.sql b/var/upgrades/2.2100.sql index bbbeb970..6122cf93 100644 --- a/var/upgrades/2.2100.sql +++ b/var/upgrades/2.2100.sql @@ -2,3 +2,4 @@ alter table empire add column `skip_medal_messages` tinyint NOT NULL default 0; alter table empire add column `skip_pollution_warnings` tinyint NOT NULL default 0; alter table empire add column `skip_resource_warnings` tinyint NOT NULL default 0; alter table empire add column `skip_happiness_warnings` tinyint NOT NULL default 0; +update ships set type='snark' where type='bomber'; \ No newline at end of file