This commit is contained in:
phidias authored and GitHub committed 2026-11-10 23:16:45 +09:00
1 parent e6d898dd95
commit 43d4452049
1 file changed
+3
+3
View File
@@ -243,6 +243,7 @@ function Vlayer.get_allocated_items(s_index)
local storage = vd.storage local storage = vd.storage
local unallocated = storage.unallocated local unallocated = storage.unallocated
for name, qnc in pairs(storage.items) do for name, qnc in pairs(storage.items) do
allocated[name] = {}
for quality, count in pairs(qnc) do for quality, count in pairs(qnc) do
allocated[name][quality] = count - (unallocated[name] and unallocated[name][quality] or 0) allocated[name][quality] = count - (unallocated[name] and unallocated[name][quality] or 0)
end end
@@ -397,9 +398,11 @@ function Vlayer.insert_item(s_index, name, count, quality_level)
end end
local unallocated = count - allocated local unallocated = count - allocated
if unallocated > 0 then
storage.unallocated[name][quality_level] = storage.unallocated[name][quality_level] + unallocated storage.unallocated[name][quality_level] = storage.unallocated[name][quality_level] + unallocated
count_unallocated_production(s_index, name, unallocated, quality_level) count_unallocated_production(s_index, name, unallocated, quality_level)
end end
end
--- Take an item out, unallocated items go first and landfill can only go while nothing is using its area --- Take an item out, unallocated items go first and landfill can only go while nothing is using its area
--- @param s_index number Surface index --- @param s_index number Surface index