Merge branch 'develop' of https://github.com/DFHack/dfhack into remote_reader

develop
JapaMala 2018-12-02 08:57:15 -06:00
commit 435e44d99b
20 changed files with 23 additions and 24 deletions

@ -63,6 +63,17 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Lua ## Lua
- ``utils``: new ``OrderedTable`` class - ``utils``: new ``OrderedTable`` class
## Structures
- ``musical_form``: named voices field
- ``musical_form_instruments``: named minimum_required and maximum_permitted
- ``dance_form``: named musical_form_id and musical_written_content_id
- ``written_content``: named poetic_form
- ``activity_event_performancest``: renamed poem as written_content_id
- ``incident_sub6_performance``: made performance_event an enum
- ``incident_sub6_performance.participants``: named performance_event and role_index
- ``incident_sub6_performance``: named poetic_form_id, musical_form_id, and dance_form_id
================================================================================ ================================================================================
# 0.44.12-r1 # 0.44.12-r1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 32 KiB

@ -879,11 +879,8 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
// Account for the military // Account for the military
else if (ENUM_ATTR(profession, military, dwarfs[dwarf]->profession)) else if (ENUM_ATTR(profession, military, dwarfs[dwarf]->profession))
dwarf_info[dwarf].state = MILITARY; dwarf_info[dwarf].state = MILITARY;
// Account for dwarves on break or migrants // Account for incoming migrants
// DF leaves the OnBreak trait type on some dwarves while they're not actually on break
// Since they have no current job, they will default to IDLE
else if (is_migrant) else if (is_migrant)
// Dwarf is unemployed with null job
{ {
dwarf_info[dwarf].state = OTHER; dwarf_info[dwarf].state = OTHER;
} }

@ -1202,14 +1202,6 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
for (int dwarf = 0; dwarf < n_dwarfs; dwarf++) for (int dwarf = 0; dwarf < n_dwarfs; dwarf++)
{ {
bool is_on_break = false;
for (auto p = dwarfs[dwarf]->status.misc_traits.begin(); p < dwarfs[dwarf]->status.misc_traits.end(); p++)
{
if ((*p)->id == misc_trait_type::Migrant /*|| (*p)->id == misc_trait_type::OnBreak*/)
is_on_break = true;
}
if (Units::isBaby(dwarfs[dwarf]) || if (Units::isBaby(dwarfs[dwarf]) ||
Units::isChild(dwarfs[dwarf]) || Units::isChild(dwarfs[dwarf]) ||
dwarfs[dwarf]->profession == profession::DRUNK) dwarfs[dwarf]->profession == profession::DRUNK)
@ -1220,7 +1212,7 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
dwarf_info[dwarf].state = MILITARY; dwarf_info[dwarf].state = MILITARY;
else if (dwarfs[dwarf]->job.current_job == NULL) else if (dwarfs[dwarf]->job.current_job == NULL)
{ {
if (is_on_break) if (Units::getMiscTrait(dwarfs[dwarf], misc_trait_type::Migrant))
dwarf_info[dwarf].state = OTHER; dwarf_info[dwarf].state = OTHER;
else if (dwarfs[dwarf]->specific_refs.size() > 0) else if (dwarfs[dwarf]->specific_refs.size() > 0)
dwarf_info[dwarf].state = OTHER; dwarf_info[dwarf].state = OTHER;

@ -1742,11 +1742,11 @@ static void add_work_history(df::unit *unit, activity_type type)
static bool is_at_leisure(df::unit *unit) static bool is_at_leisure(df::unit *unit)
{ {
for (auto p = unit->status.misc_traits.begin(); p < unit->status.misc_traits.end(); p++) if (Units::getMiscTrait(unit, misc_trait_type::Migrant))
{ return true;
if ((*p)->id == misc_trait_type::Migrant /*|| (*p)->id == misc_trait_type::OnBreak*/)
return true; if (!unit->job.current_job && Units::getMainSocialActivity(unit))
} return true;
return false; return false;
} }

@ -252,8 +252,8 @@ module DFHack
not u.specific_refs.find { |s| s.type == :ACTIVITY } and not u.specific_refs.find { |s| s.type == :ACTIVITY } and
# filter soldiers (TODO check schedule) # filter soldiers (TODO check schedule)
u.military.squad_id == -1 and u.military.squad_id == -1 and
# filter 'on break' # filter incoming migrants
not u.status.misc_traits.find { |t| t.id == :OnBreak } not u.status.misc_traits.find { |t| t.id == :Migrant }
end end
def unit_entitypositions(unit) def unit_entitypositions(unit)

@ -1122,10 +1122,9 @@ private:
return ""; return "";
for (auto p = unit->status.misc_traits.begin(); p < unit->status.misc_traits.end(); p++) for (auto p = unit->status.misc_traits.begin(); p < unit->status.misc_traits.end(); p++)
{ {
if ((*p)->id == misc_trait_type::Migrant /*|| (*p)->id == misc_trait_type::OnBreak*/) if ((*p)->id == misc_trait_type::Migrant)
{ {
int i = (*p)->value; return ".new arrival.migrant";
return ".on break";
} }
} }

@ -1492,7 +1492,7 @@ static void releaseTiredWorker(EngineInfo *engine, df::job *job, df::unit *worke
if (unit == worker || if (unit == worker ||
unit->job.current_job || !unit->status.labors[unit_labor::SIEGEOPERATE] || unit->job.current_job || !unit->status.labors[unit_labor::SIEGEOPERATE] ||
!Units::isCitizen(unit) /*|| Units::getMiscTrait(unit, misc_trait_type::OnBreak)*/ || !Units::isCitizen(unit) || Units::getMiscTrait(unit, misc_trait_type::Migrant) ||
isTired(unit) || !Maps::canWalkBetween(job->pos, unit->pos)) isTired(unit) || !Maps::canWalkBetween(job->pos, unit->pos))
continue; continue;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB