Skip to content

Commit

Permalink
Merge pull request #33 from lemming552/develop
Browse files Browse the repository at this point in the history
Fixed situation with non possible objectives in missions.
  • Loading branch information
lemming552 committed Jul 19, 2012
2 parents a408b35 + 0e22cef commit 9eb9b9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Lacuna/DB/Result/Mission.pm
Expand Up @@ -398,7 +398,7 @@ sub format_items {
$target = $stars->find($movement->{target_star_id});
}
unless (defined($target)) {
warn "fleet movement target not found";
# warn "fleet movement target not found";
next;
}
push @{$item_tmp}, 'Send '.$ship->type_formatted.' to '.$target->name.' ('.$target->x.','.$target->y.').';
Expand All @@ -421,7 +421,7 @@ sub format_items {
if (defined($item_tmp)) {
push @{$item_arr}, @{consolidate_items($item_tmp)};
}

return $item_arr;
}

Expand Down
8 changes: 6 additions & 2 deletions lib/Lacuna/RPC/Building/MissionCommand.pm
Expand Up @@ -27,12 +27,16 @@ sub get_missions {
next if $params->get('max_university_level') < $empire->university_level;
next if Lacuna->cache->get($mission->mission_file_name, $empire->id);
push @listed, $mission->mission_file_name;
my $objectives = $mission->format_objectives;
next unless defined($objectives);
my $rewards = $mission->format_rewards;
next unless defined($rewards);
push @missions, {
id => $mission->id,
name => $params->get('name'),
description => $params->get('description'),
objectives => $mission->format_objectives,
rewards => $mission->format_rewards,
objectives => $objectives,
rewards => $rewards,
max_university_level => $params->get('max_university_level'),
date_posted => $mission->date_posted_formatted,
};
Expand Down

0 comments on commit 9eb9b9b

Please sign in to comment.