From 647a637528a21e3af020b1a2f779623a38feb085 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Mon, 18 Dec 2023 22:02:47 -0300 Subject: [PATCH] preventing racing condition --- texture_management.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/texture_management.lua b/texture_management.lua index 84fa322..754e025 100644 --- a/texture_management.lua +++ b/texture_management.lua @@ -83,10 +83,11 @@ function listLoadedTextures() return loadedTextures end -airutils.all_game_textures = listLoadedTextures() - -- Function to check if a texture is in the list of loaded textures function airutils.isTextureLoaded(textureToFind) + if not airutils.all_game_textures then + airutils.all_game_textures = listLoadedTextures() + end local textures = airutils.all_game_textures for _, texture in pairs(textures) do