Add Assert For Issue 352 (#349)

* Update module_exports.lua

* Update module_exports.lua

* Link to issue rather than PR

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
2025-01-09 06:30:13 +09:00
committed by GitHub
parent b781198841
commit 60e34a0767

View File

@@ -420,6 +420,16 @@ function ExpUtil.get_storage_for_stack(options)
local current, count, entities = cache.current, cache.count, cache.entities
for i = 1, cache.count do
local entity = entities[((current + i - 1) % count) + 1]
if entity == nil then
-- See Github Issue #352 <https://github.com/explosivegaming/ExpCluster/issues/352>
error("entity was nil, context:\n" .. ExpUtil.format_any({
cache = cache,
i = i,
}, {
max_line_count = 0,
no_locale_strings = true
}))
end
if entity.can_insert(item) then
cache.current = current + 1
return entity