Assert row lookups and narrow force and style reads

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:43 +00:00
co-authored by Claude Opus 5
parent 0b31a70801
commit f9ce3c4145
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ Commands.new("ratio", { "exp-commands_ratio.description" })
local amount_of_machines = 1
if items_per_second then
amount_of_machines = math.ceil(products[1].amount * crafts_per_second)
amount_of_machines = math.ceil(assert(assert(products[1]).amount) * crafts_per_second)
end
for _, ingredient in ipairs(ingredients) do
@@ -43,7 +43,7 @@ Commands.new("ratio", { "exp-commands_ratio.description" })
for i, product in ipairs(products) do
Commands.print{
product.type == "item" and "exp-commands_ratio.item-out" or "exp-commands_ratio.fluid-out",
math.round(product.amount * crafts_per_second, 3),
math.round(assert(product.amount) * crafts_per_second, 3),
product.name
}
end