diff --git a/docs/Lua API.rst b/docs/Lua API.rst index 226c93aa2..5450aee45 100644 --- a/docs/Lua API.rst +++ b/docs/Lua API.rst @@ -1076,15 +1076,17 @@ Job module Returns the unit performing the job. -* ``dfhack.job.setJobCooldown(building,worker,timeout)`` +* ``dfhack.job.setJobCooldown(building,worker,cooldown)`` - Prevent the worker from taking jobs at the specified workshop for the specified time. - This doesn't decrease the timeout in any circumstances. + Prevent the worker from taking jobs at the specified workshop for the + specified cooldown period (in ticks). This doesn't decrease the cooldown + period in any circumstances. -* ``dfhack.job.removeWorker(job,timeout)`` +* ``dfhack.job.removeWorker(job,cooldown)`` - Removes the worker from the specified workshop job, and sets the cooldown. - Returns *true* on success. + Removes the worker from the specified workshop job, and sets the cooldown + period (using the same logic as ``setJobCooldown``). Returns *true* on + success. * ``dfhack.job.checkBuildingsNow()`` diff --git a/docs/changelog.txt b/docs/changelog.txt index 9317df86e..7247b665d 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -33,6 +33,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: # Future +## Fixes +- `stockpiles`: fixed a crash when loading food stockpiles + # 0.47.04-r2 ## New Tweaks diff --git a/plugins/stockpiles/OrganicMatLookup.cpp b/plugins/stockpiles/OrganicMatLookup.cpp index 4f1076cd1..09ac9c659 100644 --- a/plugins/stockpiles/OrganicMatLookup.cpp +++ b/plugins/stockpiles/OrganicMatLookup.cpp @@ -152,4 +152,4 @@ MaterialInfo OrganicMatLookup::food_mat_by_token ( std::ostream &out, const std: } bool OrganicMatLookup::index_built = false; -std::vector OrganicMatLookup::food_index = std::vector ( 37 ); +std::vector OrganicMatLookup::food_index = std::vector ( df::enum_traits< df::organic_mat_category >::last_item_value + 1 );