Skip to content

Commit 6aa75f2

Browse files
Merge remote-tracking branch 'upstream/develop' into SquidHack
2 parents c3cdce4 + 430678d commit 6aa75f2

File tree

7 files changed

+31
-11
lines changed

7 files changed

+31
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cmake_policy(SET CMP0074 NEW)
77

88
# set up versioning.
99
set(DF_VERSION "52.03")
10-
set(DFHACK_RELEASE "r1.1")
10+
set(DFHACK_RELEASE "r2")
1111
set(DFHACK_PRERELEASE FALSE)
1212
set(SQUIDHACK_INFO "Compatible with DFxTwitch v0.1.x")
1313

docs/changelog.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ Template for new versions:
5353

5454
## New Tools
5555

56+
## New Features
57+
58+
## Fixes
59+
60+
## Misc Improvements
61+
62+
## Documentation
63+
64+
## API
65+
66+
## Lua
67+
68+
## Removed
69+
70+
# 52.03-r2
71+
72+
## New Tools
73+
5674
## New Features
5775
- `nestboxes`: allow limiting egg protection to nestboxes inside a designated burrow
5876
- `tailor`: tailor now provides optional dye automation
@@ -70,7 +88,6 @@ Template for new versions:
7088
- ``Units``: new functions ``getFocusPenalty``, ``unbailableSocialActivity``, ``isJobAvailable``
7189

7290
## Lua
73-
7491
- New functions: ``dfhack.jobs.createLinked``, ``dfhack.jobs.assignToWorkshop``, ``dfhack.units.getFocusPenalty``, ``dfhack.units.unbailableSocialActivity``, and ``dfhack.units.isJobAvailable``
7592

7693
## Removed

docs/dev/Lua API.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,11 +1908,12 @@ Units module
19081908

19091909
Unit has an uninterruptible social activity (e.g. a purple "Socialize!").
19101910

1911-
* ``dfhack.units.isJobAvailable(unit [, interrupt_social])``
1911+
* ``dfhack.units.isJobAvailable(unit [, preserve_social])``
19121912

19131913
Check whether a unit can be assigned to (i.e. is looking for) a job. Will
19141914
return ``true`` if the unit is engaged in "green" social activities, unless
1915-
the boolean ``interrupt_social`` is true.
1915+
the boolean ``preserve_social`` is true. Will never interrupt uninterruptible
1916+
social activities (e.g. a purple "Socialize!").
19161917

19171918
* ``dfhack.units.getFocusPenalty(unit, need_type [, need_type, ...])``
19181919

library/include/modules/Units.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ DFHACK_EXPORT int32_t getFocusPenalty(df::unit* unit, df::need_type need_type);
350350
// unit has an unbailable social activity (e.g. "Socialize!")
351351
DFHACK_EXPORT bool hasUnbailableSocialActivity(df::unit *unit);
352352
// unit can be assigned a job
353-
DFHACK_EXPORT bool isJobAvailable(df::unit *unit, bool interrupt_social);
353+
DFHACK_EXPORT bool isJobAvailable(df::unit *unit, bool preserve_social);
354354

355355
// Stress categories. 0 is highest stress, 6 is lowest.
356356
DFHACK_EXPORT extern const std::vector<int32_t> stress_cutoffs;

library/modules/Units.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,8 @@ bool Units::isJobAvailable(df::unit *unit, bool preserve_social = false){
20902090
return false;
20912091
if (unit->flags1.bits.caged || unit->flags1.bits.chained)
20922092
return false;
2093+
if (Units::getSpecificRef(unit, df::specific_ref_type::ACTIVITY))
2094+
return false;
20932095
if (unit->individual_drills.size() > 0) {
20942096
if (unit->individual_drills.size() > 1)
20952097
return false; // this is even possible

library/xml

Submodule xml updated 1 file

plugins/tailor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace DFHack {
5454
}
5555

5656
static const string CONFIG_KEY = string(plugin_name) + "/config";
57-
static const string CONFIG_KEY_2 = string(plugin_name) + "/config1";
57+
static const string CONFIG_KEY_2 = string(plugin_name) + "/config_2";
5858
static PersistentDataItem config;
5959
static PersistentDataItem config2;
6060

@@ -885,8 +885,6 @@ DFhackCExport command_result plugin_shutdown (color_ostream &out) {
885885
return CR_OK;
886886
}
887887

888-
889-
890888
DFhackCExport command_result plugin_load_site_data (color_ostream &out) {
891889
cycle_timestamp = 0;
892890
config = World::GetPersistentSiteData(CONFIG_KEY);
@@ -910,7 +908,6 @@ DFhackCExport command_result plugin_load_site_data (color_ostream &out) {
910908
config.set_bool(CONFIG_CONFISCATE, true);
911909
}
912910

913-
config2 = World::GetPersistentSiteData(CONFIG_KEY_2);
914911
// transition existing saves to CONFIG_AUTOMATE_DYE=false
915912
if (config2.get_int(CONFIG_AUTOMATE_DYE) < 0)
916913
{
@@ -922,9 +919,12 @@ DFhackCExport command_result plugin_load_site_data (color_ostream &out) {
922919
DEBUG(control,out).print("loading persisted enabled state: %s\n",
923920
is_enabled ? "true" : "false");
924921
tailor_instance->set_confiscate(config.get_bool(CONFIG_CONFISCATE));
925-
tailor_instance->set_automate_dye(config2.get_bool(CONFIG_AUTOMATE_DYE));
926922
DEBUG(control,out).print("loading persisted confiscation state: %s\n",
927923
tailor_instance->get_confiscate() ? "true" : "false");
924+
tailor_instance->set_automate_dye(config2.get_bool(CONFIG_AUTOMATE_DYE));
925+
DEBUG(control, out).print("loading persisted dye automation state: %s\n",
926+
tailor_instance->get_automate_dye() ? "true" : "false");
927+
928928
tailor_instance->sync_material_order();
929929

930930
return CR_OK;

0 commit comments

Comments
 (0)