Skip to content

Commit 411ecc3

Browse files
committed
Normalize scope name handling for case sensitivity on Linux
1 parent 3d8f6e6 commit 411ecc3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Modules/StatDescriber.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ local scopes = { }
1313
local function getScope(scopeName)
1414
if not scopes[scopeName] then
1515
local scope = nil
16-
local file = io.open("Data/StatDescriptions/Specific_Skill_Stat_Descriptions/"..scopeName..".lua", 'rb')
16+
-- Allow lowercase "specific_skill_stat_descriptions/<name>" by stripping the prefix (Linux is case-sensitive).
17+
local normalizedScopeName = scopeName:gsub("^specific_skill_stat_descriptions/", "")
18+
19+
local file = io.open("Data/StatDescriptions/Specific_Skill_Stat_Descriptions/"..normalizedScopeName..".lua", 'rb')
1720
if file then
1821
file:close()
19-
scope = LoadModule("Data/StatDescriptions/Specific_Skill_Stat_Descriptions/"..scopeName)
22+
scope = LoadModule("Data/StatDescriptions/Specific_Skill_Stat_Descriptions/"..normalizedScopeName)
2023
else
21-
scope = LoadModule("Data/StatDescriptions/"..scopeName)
24+
scope = LoadModule("Data/StatDescriptions/"..normalizedScopeName)
2225
end
2326
scope.name = scopeName
2427
if scope.parent then

0 commit comments

Comments
 (0)