From 32d479b6f160253f709008096c8dbcd9f2debd58 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Sat, 14 Jun 2025 02:33:32 +0200 Subject: [PATCH] fix typo and wrap extraction logic in do block instead --- WeakAuras/Types.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 3f6e45d..3673f95 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -1238,19 +1238,20 @@ end -- Extract Race names from faction IDs WeakAuras.race_types = {} -local ids = { - [1]="Human", [2]="Orc", [3]="Dwarf", [4]="Night Elf", [5]="Undead", - [6]="Tauren", [8]="Gnome", [9]="Troll", [914]="BloodElf", [927]="Draenei", -} -for id, key in pairs(ids) do - local raw = GetFactionInfoByID(id) - local name = type(raw) == "string" - and (raw:match("^[^,:]*[,:](.+)$") or raw) - :match("^%s*(.-)%s*$") - or key - WeakAuras.race_types[key] = (name == "" and key) or name +do + local race_ids = { + [1]="Human", [2]="Orc", [3]="Dwarf", [4]="NightElf", [5]="Undead", + [6]="Tauren", [8]="Gnome", [9]="Troll", [914]="BloodElf", [927]="Draenei", + } + for id, key in pairs(race_ids) do + local raw = GetFactionInfoByID(id) + local name = type(raw) == "string" + and (raw:match("^[^,:]*[,:](.+)$") or raw) + :match("^%s*(.-)%s*$") + or key + WeakAuras.race_types[key] = (name == "" and key) or name + end end -ids = nil Private.faction_group = { Alliance = L["Alliance"],