Przeglądaj źródła

Still not there

Piotr Czajkowski 2 lat temu
rodzic
commit
dc3ac09d74
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      19/code.go

+ 2 - 2
19/code.go

@@ -198,12 +198,12 @@ func checkPlan(plan blueprint) int {
 				newRobots.obsidian++
 				resources = produceObsidian(plan, resources)
 			}
-		} else if canProduceClay(plan, resources) {
+		} else if robots.clay < plan.obsidianCost[1] && canProduceClay(plan, resources) {
 			if shouldProduceClay(plan, robots, resources) {
 				newRobots.clay++
 				resources = produceClay(plan, resources)
 			}
-		} else if canProduceOre(plan, resources) {
+		} else if robots.ore < plan.clayCost && canProduceOre(plan, resources) {
 			if shouldProduceClay(plan, robots, resources) {
 				newRobots.ore++
 				resources = produceOre(plan, resources)