From 18da3d4410e55fc6138673921bf1e21bf597535b Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 18 Jul 2024 09:10:40 -0700 Subject: [PATCH] harden against race condition --- scripts/kheAA/liquidLib.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/kheAA/liquidLib.lua b/scripts/kheAA/liquidLib.lua index a4cee8c223..dfcbf72ec7 100644 --- a/scripts/kheAA/liquidLib.lua +++ b/scripts/kheAA/liquidLib.lua @@ -24,6 +24,10 @@ function liquidLib.init() end function liquidLib.itemToLiquidId(item) + if not liquidLib.vars then + --sb.logInfo("LiquidLib.lua: Object %s called itemToLiquidId before init. what?",object.name()) + liquidLib.init() + end if liquidLib.vars.liquidDataBuffer[item.name] then if liquidLib.vars.liquidDataBuffer[item.name].id>0 then return liquidLib.vars.liquidDataBuffer[item.name].id