Skip to content

Commit 217a06a

Browse files
authored
Merge pull request #5393 from myk002/myk_unbreak_my_heart
also unbreak unload -a
2 parents d823505 + 8cde8f7 commit 217a06a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

docs/changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Template for new versions:
6161
- `dig-now`: fix cases where boulders/rough gems of incorrect material were being generated when digging through walls
6262
- `dig-now`: properly generate ice boulders when digging through ice walls
6363
- `gui/teleport`: now properly handles teleporting units that are currently falling or being flung
64-
- ``Core.cpp``: now properly handles "load", "unload", and "reload" plugin commands given to Core::runCommand()
64+
- `unload`: fix recent regression where `unload` would immediately `reload` the target
6565

6666
## Misc Improvements
6767
- `spectate`: show dwarves' activities (like prayer)

library/Core.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -818,19 +818,22 @@ command_result Core::runCommand(color_ostream &con, const std::string &first_, s
818818
ret = CR_FAILURE;
819819
else if (unload && !plug_mgr->unloadAll())
820820
ret = CR_FAILURE;
821-
else if (!plug_mgr->reloadAll())
821+
else if (reload && !plug_mgr->reloadAll())
822822
ret = CR_FAILURE;
823823
}
824-
for (auto p = parts.begin(); p != parts.end(); p++)
824+
else
825825
{
826-
if (!p->size() || (*p)[0] == '-')
827-
continue;
828-
if (load && !plug_mgr->load(*p))
829-
ret = CR_FAILURE;
830-
else if (unload && !plug_mgr->unload(*p))
831-
ret = CR_FAILURE;
832-
else if (reload && !plug_mgr->reload(*p))
833-
ret = CR_FAILURE;
826+
for (auto p = parts.begin(); p != parts.end(); p++)
827+
{
828+
if (!p->size() || (*p)[0] == '-')
829+
continue;
830+
if (load && !plug_mgr->load(*p))
831+
ret = CR_FAILURE;
832+
else if (unload && !plug_mgr->unload(*p))
833+
ret = CR_FAILURE;
834+
else if (reload && !plug_mgr->reload(*p))
835+
ret = CR_FAILURE;
836+
}
834837
}
835838
if (ret != CR_OK)
836839
con.printerr("%s failed\n", first.c_str());

0 commit comments

Comments
 (0)