From a90fd9662b156fbb6f2f346ef1a61b5d58cd4e1d Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 14 Nov 2010 10:40:42 -0600 Subject: [PATCH] don't take flying ships --- lib/Lacuna/DB/Result/Mission.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/Lacuna/DB/Result/Mission.pm b/lib/Lacuna/DB/Result/Mission.pm index b5f054be..02d4311a 100644 --- a/lib/Lacuna/DB/Result/Mission.pm +++ b/lib/Lacuna/DB/Result/Mission.pm @@ -137,7 +137,13 @@ sub spend_objectives { if (exists $objectives->{ships}) { foreach my $ship (@{$objectives->{ships}}) { $body->ships->search( - { type => $ship->{type}, speed => {'>=' => $ship->{speed}}, stealth => {'>=' => $ship->{stealth}}, hold_size => {'>=' => $ship->{hold_size}} }, + { + task => 'Docked', + type => $ship->{type}, + speed => {'>=' => $ship->{speed}}, + stealth => {'>=' => $ship->{stealth}}, + hold_size => {'>=' => $ship->{hold_size}}, + }, {rows => 1, order_by => 'id'} )->single->delete; } @@ -192,11 +198,12 @@ sub check_objectives { my @ids; foreach my $ship (@{$objectives->{ships}}) { my $this = $body->ships->search({ - type => $ship->{type}, - speed => {'>=' => $ship->{speed}}, - stealth => {'>=' => $ship->{stealth}}, - hold_size => {'>=' => $ship->{hold_size}}, - id => { 'not in' => \@ids }, + type => $ship->{type}, + speed => {'>=' => $ship->{speed}}, + stealth => {'>=' => $ship->{stealth}}, + hold_size => {'>=' => $ship->{hold_size}}, + task => 'Docked', + id => { 'not in' => \@ids }, },{ rows =>1, order_by => 'id', -- 2.54.0