mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract --repair-zone / --repair-project into cli_repair.cpp
Moves the two manifest-drift fix handlers (--repair-zone,
--repair-project) out of main.cpp into a new cli_repair.{hpp,cpp}
module. Both auto-fix the common manifest-vs-disk
inconsistencies that accumulate when zones are hand-edited or
partially copied — adding orphan WHM tiles to the manifest,
syncing the hasCreatures flag with the actual creatures.json
content, and warning (not removing) for tiles in the manifest
without backing files. Both honor --dry-run for safe previews.
main.cpp shrinks by 155 lines (3,946 to 3,791).
This commit is contained in:
parent
3d52d5fd20
commit
73b4a6362f
4 changed files with 226 additions and 159 deletions
19
tools/editor/cli_repair.hpp
Normal file
19
tools/editor/cli_repair.hpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the repair-* manifest-drift fix handlers — auto-fix
|
||||
// the common manifest-vs-disk inconsistencies that accumulate
|
||||
// when zones are hand-edited or partially copied. Both honor
|
||||
// --dry-run for safe previews.
|
||||
// --repair-zone fix one zone (sync tiles, hasCreatures)
|
||||
// --repair-project per-zone wrapper with aggregate tally
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleRepair(int& i, int argc, char** argv, int& outRc);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue