Merge pull request #3654 from myk002/myk_mod_reload

ensure active mod scripts are properly reloaded
develop
Myk 2023-08-07 19:39:39 -07:00 committed by GitHub
commit 970babe77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

@ -56,6 +56,7 @@ Template for new versions:
## New Features ## New Features
## Fixes ## Fixes
- Core: properly reload scripts in mods when a world is unloaded and immediately loaded again
## Misc Improvements ## Misc Improvements
- `hotkeys`: don't display DFHack logo in legends mode since it covers up important interface elements. the Ctrl-Shift-C hotkey to bring up the menu and the mouseover hotspot still function, though. - `hotkeys`: don't display DFHack logo in legends mode since it covers up important interface elements. the Ctrl-Shift-C hotkey to bring up the menu and the mouseover hotspot still function, though.

@ -51,9 +51,10 @@ function reload(refresh_active_mod_scripts)
enabled_map = utils.OrderedTable() enabled_map = utils.OrderedTable()
local force_refresh_fn = refresh_active_mod_scripts and function(script_path, script_name) local force_refresh_fn = refresh_active_mod_scripts and function(script_path, script_name)
if script_path:find('scripts_modactive') then if script_path:find('scripts_modactive') then
internal_script = dfhack.internal.scripts[script_path..'/'..script_name] local full_path = script_path..'/'..script_name
internal_script = dfhack.internal.scripts[full_path]
if internal_script then if internal_script then
internal_script.env = nil dfhack.internal.scripts[full_path] = nil
end end
end end
end or nil end or nil