From bdd2d68c94a2d0f91f9035a214bfd14b49b342ad Mon Sep 17 00:00:00 2001 From: Alexander Sedov <alex0player@gmail.com> Date: Sat, 24 Jan 2015 16:45:21 +0300 Subject: [PATCH] Added missing tables in font size --- game/engines/default/engine/utils.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game/engines/default/engine/utils.lua b/game/engines/default/engine/utils.lua index 8ce2dddd6d..ce65ca1900 100644 --- a/game/engines/default/engine/utils.lua +++ b/game/engines/default/engine/utils.lua @@ -861,10 +861,11 @@ local word_size_cache = {} local fontoldsize = getmetatable(tmps).__index.size getmetatable(tmps).__index.simplesize = fontoldsize local fontcachewordsize = function(font, fstyle, v) - if not word_size_cache[font][fstyle][v] then - word_size_cache[font][fstyle][v] = {fontoldsize(font, v)} + local cache = table.getTable(word_size_cache, font, fstyle) + if not cache[v] then + cache[v] = {fontoldsize(font, v)} end - return unpack(word_size_cache[font][fstyle][v]) + return unpack(cache[v]) end getmetatable(tmps).__index.size = function(font, str) local tstr = str:toTString() -- GitLab