summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--19.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/19.c b/19.c
index 2700712..2a86c26 100644
--- a/19.c
+++ b/19.c
@@ -256,6 +256,7 @@ inventory_build_exhaustive(struct inventory * i, struct blueprint const * b, int
// Try building a obsidian robot, and checking if that's better than anything else
if (i->bsdn.robots < b->max_bsdn
+ && i->bsdn.amount < 2 * b->max_bsdn
&& inventory_build(&test, b, BSDN) == 0)
{
// fprintf(stderr, "%d: building a bsdn robot (%ld)\n", remaining, test.bsdn.amount);
@@ -268,6 +269,7 @@ inventory_build_exhaustive(struct inventory * i, struct blueprint const * b, int
// Try building a clay robot, and checking if that's better than anything else
if (i->clay.robots < b->max_clay
+ && i->clay.amount < 2 * b->max_clay
&& remaining > 5
&& inventory_build(&test, b, CLAY) == 0)
{
@@ -281,6 +283,7 @@ inventory_build_exhaustive(struct inventory * i, struct blueprint const * b, int
// Try building a ore robot, and checking if that's better than anything else
if (i->ore.robots < b->max_ore
+ && i->ore.amount < 2 * b->max_ore
&& remaining > 10
&& inventory_build(&test, b, ORE) == 0)
{