From 4a087a3324bd9b50b1ad7bdfe79ea86f07bd8f3d Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Fri, 3 Jan 2025 19:12:17 +0000 Subject: [PATCH] Fix cache for get_storage_for_stack --- exp_util/module/module_exports.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exp_util/module/module_exports.lua b/exp_util/module/module_exports.lua index d9638d98..a98b1e71 100644 --- a/exp_util/module/module_exports.lua +++ b/exp_util/module/module_exports.lua @@ -406,7 +406,7 @@ function ExpUtil.get_storage_for_stack(options) -- Perform a search if on has not been done already local cache = options.cache - if cache then + if not cache then local entities = surface.find_entities_filtered(options) cache = { entities = entities, @@ -415,7 +415,6 @@ function ExpUtil.get_storage_for_stack(options) } options.cache = cache end - --- @cast cache -nil -- Find a valid entity from the search results local current, count, entities = cache.current, cache.count, cache.entities