From 2ed49bf48fbef3a17d8fa57fcd00b419f320b1bd Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 11 Sep 2010 14:55:16 -0400 Subject: [PATCH 1/3] fixed error message --- lib/Lacuna/RPC/Building/Trade.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/RPC/Building/Trade.pm b/lib/Lacuna/RPC/Building/Trade.pm index 90491305..3b5cbf1b 100644 --- a/lib/Lacuna/RPC/Building/Trade.pm +++ b/lib/Lacuna/RPC/Building/Trade.pm @@ -104,7 +104,7 @@ sub accept_trade { } else { unless ($body->type_stored($trade->ask_type) >= $trade->ask_quantity) { - confess [1011, 'You need at least '.$trade->ask_quantity.' '.$body->ask_type.' to make this trade.']; + confess [1011, 'You need at least '.$trade->ask_quantity.' '.$trade->ask_type.' to make this trade.']; } $body->spend_type($trade->ask_type, $trade->ask_quantity); $body->update; -- 2.54.0 From 07bd1cad10cbcb24f4c9aee5018c656b8017b109 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 12 Sep 2010 16:47:44 -0400 Subject: [PATCH 2/3] fixed pushing problem --- lib/Lacuna/Role/Trader.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/Role/Trader.pm b/lib/Lacuna/Role/Trader.pm index c8f6e7b0..726c4831 100644 --- a/lib/Lacuna/Role/Trader.pm +++ b/lib/Lacuna/Role/Trader.pm @@ -242,7 +242,7 @@ sub structure_push { my $payload; foreach my $item (@{$items}) { given($item->{type}) { - when ([qw(water energy waste ORE_TYPES FOOD_TYPES)]) { + when ([qw(water energy waste), ORE_TYPES, FOOD_TYPES]) { $body->spend_type($item->{type}, $item->{quantity}); $body->update; $payload->{resources}{$item->{type}} += $item->{quantity}; -- 2.54.0 From 68a5b9e10012a15088048334d8d57c0a5245a3af Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 12 Sep 2010 16:49:47 -0400 Subject: [PATCH 3/3] bad qw --- lib/Lacuna/Role/Trader.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/Role/Trader.pm b/lib/Lacuna/Role/Trader.pm index 726c4831..ba85159e 100644 --- a/lib/Lacuna/Role/Trader.pm +++ b/lib/Lacuna/Role/Trader.pm @@ -220,7 +220,7 @@ sub structure_push { my $space_used; foreach my $item (@{$items}) { given($item->{type}) { - when ([qw(water energy waste ORE_TYPES FOOD_TYPES)]) { + when ([qw(water energy waste), ORE_TYPES, FOOD_TYPES]) { confess $have_exception unless ($body->type_stored($item->{type}) >= $item->{quantity}); $space_used += $item->{quantity}; } -- 2.54.0