From 5eeb44b4db943092e6a40bb3d5fa33a7cc5628ad Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 14 Nov 2010 10:47:10 -0600 Subject: [PATCH] can't recycle nothing --- lib/Lacuna/DB/Result/Building/Waste/Recycling.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Lacuna/DB/Result/Building/Waste/Recycling.pm b/lib/Lacuna/DB/Result/Building/Waste/Recycling.pm index 85e7eb4b..2c0aec55 100644 --- a/lib/Lacuna/DB/Result/Building/Waste/Recycling.pm +++ b/lib/Lacuna/DB/Result/Building/Waste/Recycling.pm @@ -37,6 +37,9 @@ sub can_recycle { if ($water < 0 || $ore < 0 || $energy < 0) { confess [1011, "You cannot create negative resources."]; } + if (($water + $ore + $energy) == 0) { + confess [1011, "You cannot recycle 0 resources."]; + } if (($water + $ore + $energy) > $self->body->waste_stored) { confess [1011, "You don't have that much waste in storage.", [($water + $ore + $energy), $self->body->waste_stored]]; } -- 2.54.0