mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
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:
@@ -420,6 +420,16 @@ function ExpUtil.get_storage_for_stack(options)
|
|||||||
local current, count, entities = cache.current, cache.count, cache.entities
|
local current, count, entities = cache.current, cache.count, cache.entities
|
||||||
for i = 1, cache.count do
|
for i = 1, cache.count do
|
||||||
local entity = entities[((current + i - 1) % count) + 1]
|
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
|
if entity.can_insert(item) then
|
||||||
cache.current = current + 1
|
cache.current = current + 1
|
||||||
return entity
|
return entity
|
||||||
|
|||||||
Reference in New Issue
Block a user