From 31c3f4fbb2c1ca4e9173a7b2bd6100d2ca74e7ac Mon Sep 17 00:00:00 2001 From: Droseran <97368320+Droseran@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:51:36 -0400 Subject: [PATCH 1/2] Fix getModStatePath() crash Changed "+" to ".." since Lua attempts to perform arithmetic instead of string concatenation when using the former. This causes a Lua script to crash when this function is called. --- library/lua/script-manager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/lua/script-manager.lua b/library/lua/script-manager.lua index cb4abf1f53..cc4a02c6cd 100644 --- a/library/lua/script-manager.lua +++ b/library/lua/script-manager.lua @@ -246,7 +246,7 @@ function getModSourcePath(mod_id) end function getModStatePath(mod_id) - local path = (dfhack.getConfigPath() + ('/mods/%s/')):format(mod_id) + local path = (dfhack.getConfigPath() .. ('/mods/%s/')):format(mod_id) if not dfhack.filesystem.mkdir_recursive(path) then error(('failed to create mod state directory: "%s"'):format(path)) end From 6581e295af1b441df8806d8a4205fb29287ecd41 Mon Sep 17 00:00:00 2001 From: Droseran <97368320+Droseran@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:53:56 -0400 Subject: [PATCH 2/2] Update changelog.txt --- docs/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 1e8961c7be..6fffb49e54 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -60,6 +60,7 @@ Template for new versions: ## New Features ## Fixes +- Fixed ``scriptmanager.getModStatePath()`` causing scripts to crash when called ## Misc Improvements