Skip to content

Commit

Permalink
fixed broken merge, fixed minor bug with trade
Browse files Browse the repository at this point in the history
  • Loading branch information
ian docherty committed Nov 9, 2011
1 parent 943b15f commit 28d9f46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Building.pm
Expand Up @@ -375,7 +375,7 @@ sub food_hour {
sub building_reduction_bonus {
my ($self) = @_;
my $empire = $self->body->empire;
return (time < $empire->building_boost->epoch) ? 100/75 : 1;
return (time < $empire->building_boost->epoch) ? 0.75 : 1;
}

sub energy_production_bonus {
Expand Down
10 changes: 5 additions & 5 deletions lib/Lacuna/Role/Trader.pm
Expand Up @@ -50,14 +50,14 @@ sub check_payload {
confess $offer_nothing_exception unless ($item->{quantity} > 0);
confess $fractional_offer_exception if ($item->{quantity} != int($item->{quantity}));
confess $have_exception unless ($body->type_stored($item->{type}) >= $item->{quantity});
push @expanded_items, $item;
# push @expanded_items, $item;
$space_used += $item->{quantity};
}
when ('glyph') {
if ($item->{glyph_id}) {
my $glyph = Lacuna->db->resultset('Lacuna::DB::Result::Glyphs')->find($item->{glyph_id});
confess $have_exception unless (defined $glyph && $self->body_id eq $glyph->body_id);
push @expanded_items, $item;
# push @expanded_items, $item;
$space_used += 100;
}
elsif ($item->{quantity}) {
Expand All @@ -81,7 +81,7 @@ sub check_payload {
if ($item->{plan_id}) {
my $plan = Lacuna->db->resultset('Lacuna::DB::Result::Plans')->find($item->{plan_id});
confess $have_exception unless (defined $plan && $self->body_id eq $plan->body_id);
push @expanded_items, $item;
# push @expanded_items, $item;
$space_used += 10000;
}
elsif ($item->{quantity}) {
Expand Down Expand Up @@ -110,14 +110,14 @@ sub check_payload {
confess [1002, 'You must specify a prisoner_id if you are pushing a prisoner.'] unless $item->{prisoner_id};
my $prisoner = Lacuna->db->resultset('Lacuna::DB::Result::Spies')->find($item->{prisoner_id});
confess $have_exception unless (defined $prisoner && $self->body_id eq $prisoner->on_body_id && $prisoner->task eq 'Captured');
push @expanded_items, $item;
# push @expanded_items, $item;
$space_used += 350;
}
when ('ship') {
if ($item->{ship_id}) {
my $ship = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->find($item->{ship_id});
confess $have_exception unless (defined $ship && $self->body_id eq $ship->body_id && $ship->task eq 'Docked');
push @expanded_items, $item;
# push @expanded_items, $item;
$space_used += 50000;
}
elsif ($item->{quantity}) {
Expand Down

0 comments on commit 28d9f46

Please sign in to comment.