From 86bc5be618c95d5b74f4c4628aa03fcd1e82ccd0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 28 Nov 2024 15:08:14 +0100 Subject: [PATCH] Add fallback in tt_base --- mods/tt_base/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/tt_base/init.lua b/mods/tt_base/init.lua index 623b54b8..3ae52a94 100644 --- a/mods/tt_base/init.lua +++ b/mods/tt_base/init.lua @@ -80,7 +80,13 @@ tt.register_snippet(function(itemstring) if def._tt_food then desc = S("Food item") if def._tt_food_hp then - local msg = PS("+@1 food point", "+@1 food points", def._tt_food_hp, def._tt_food_hp) + local msg + if PS then + msg = PS("+@1 food point", "+@1 food points", def._tt_food_hp, def._tt_food_hp) + else + -- fallback when plural forms are unavailable + msg = S("+@1 food points", def._tt_food_hp) + end desc = desc .. "\n" .. msg end end