diff --git a/docs/changelog.txt b/docs/changelog.txt index 2226d5a20..6d68f7586 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -50,6 +50,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Internals ## Removed +- ``fix-job-postings`` from the `workflow` plugin is now obsolete since affected savegames can no longer be loaded # 0.47.05-r8 diff --git a/docs/plugins/workflow.rst b/docs/plugins/workflow.rst index f085a40da..822b525f9 100644 --- a/docs/plugins/workflow.rst +++ b/docs/plugins/workflow.rst @@ -5,9 +5,6 @@ workflow :summary: Manage automated item production rules. :tags: fort auto jobs -.. dfhack-command:: fix-job-postings - :summary: Fixes crashes caused by old versions of workflow. - Manage repeat jobs according to stock levels. `gui/workflow` provides a simple front-end integrated in the game UI. @@ -59,12 +56,6 @@ Usage List active constraints as workflow commands that re-create them; this list can be copied to a file, and then reloaded using the `script` built-in command. -``fix-job-postings [dry-run]`` - Fixes crashes caused by the version of workflow released with DFHack - 0.40.24-r4. It will be run automatically if needed. If your save has never - been run with this version, you will never need this command. Specify the - ``dry-run`` keyword to see what this command would do without making any - changes to game state. Examples -------- diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 83f312bfd..3f132616b 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -58,13 +58,10 @@ REQUIRE_GLOBAL(job_next_id); /* Plugin registration */ static command_result workflow_cmd(color_ostream &out, vector & parameters); -static command_result fix_job_postings_cmd(color_ostream &out, vector ¶meters); static void init_state(color_ostream &out); static void cleanup_state(color_ostream &out); -static int fix_job_postings(color_ostream *out = NULL, bool dry_run = false); - DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { if (!world || !ui) @@ -76,10 +73,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector ¶meters) -{ - bool dry = parameters.size(); - int fixed = fix_job_postings(&out, dry); - out << fixed << " job issue(s) " << (dry ? "detected but not fixed" : "fixed") << endl; - return CR_OK; -} - /****************************** * JOB STATE TRACKING STRUCTS * ******************************/ @@ -354,34 +339,6 @@ public: } }; -static int fix_job_postings (color_ostream *out, bool dry_run) -{ - int count = 0; - df::job_list_link *link = &world->jobs.list; - while (link) - { - df::job *job = link->item; - if (job) - { - for (size_t i = 0; i < world->jobs.postings.size(); ++i) - { - df::job_handler::T_postings *posting = world->jobs.postings[i]; - if (posting->job == job && i != size_t(job->posting_index) && !posting->flags.bits.dead) - { - ++count; - if (out) - *out << "Found extra job posting: Job " << job->id << ": " - << Job::getName(job) << endl; - if (!dry_run) - posting->flags.bits.dead = true; - } - } - } - link = link->next; - } - return count; -} - /****************************** * GLOBAL VARIABLES * ******************************/ @@ -478,11 +435,6 @@ static ItemConstraint *get_constraint(color_ostream &out, const std::string &str static void start_protect(color_ostream &out) { - out << "workflow: checking for existing job issues" << endl; - int count = fix_job_postings(&out); - if (count) - out << "workflow: fixed " << count << " job issues" << endl; - check_lost_jobs(out, 0); if (!known_jobs.empty()) @@ -1569,13 +1521,6 @@ static int getCountHistory(lua_State *L) return 1; } -static int fixJobPostings(lua_State *L) -{ - bool dry = lua_toboolean(L, 1); - lua_pushinteger(L, fix_job_postings(NULL, dry)); - return 1; -} - DFHACK_PLUGIN_LUA_FUNCTIONS { DFHACK_LUA_FUNCTION(deleteConstraint), DFHACK_LUA_END @@ -1586,7 +1531,6 @@ DFHACK_PLUGIN_LUA_COMMANDS { DFHACK_LUA_COMMAND(findConstraint), DFHACK_LUA_COMMAND(setConstraint), DFHACK_LUA_COMMAND(getCountHistory), - DFHACK_LUA_COMMAND(fixJobPostings), DFHACK_LUA_END };