Merge remote-tracking branch 'remotes/DFHack/master' into RemoteServerUnsafe

develop
Japa Mala Illo 2017-11-25 10:24:51 +05:30
commit 272f51ef4b
14 changed files with 77 additions and 18 deletions

@ -141,7 +141,7 @@ endif()
# set up versioning. # set up versioning.
set(DF_VERSION "0.43.05") set(DF_VERSION "0.43.05")
SET(DFHACK_RELEASE "r2") SET(DFHACK_RELEASE "r3")
SET(DFHACK_PRERELEASE FALSE) SET(DFHACK_PRERELEASE FALSE)
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

@ -36,6 +36,47 @@ Changelog
.. contents:: .. contents::
:depth: 2 :depth: 2
DFHack 0.43.05-r3
=================
Internals
---------
- Fixed an uncommon crash that could occur when printing text to the console
- Added lots of previously-missing DF classes
- More names for fields: https://github.com/DFHack/df-structures/compare/0.43.05-r2...0.43.05
Fixes
-----
- Linux: fixed argument to ``setarch`` in the ``dfhack`` launcher script
- Ruby: fixed an error that occurred when the DF path contained an apostrophe
- `diggingInvaders` now compiles again and is included
- `labormanager`:
- stopped waiting for on-duty military dwarves with minor injuries to obtain care
- stopped waiting for meetings when participant(s) are dead
- fixed a crash for dwarves with no cultural identity
- `luasocket`: fixed ``receive()`` with a byte count
- `orders`: fixed an error when importing orders with material categories
- `siren`: fixed an error
- `stockpiles`: fixed serialization of barrel and bin counts
- `view-item-info`: fixed a ``CHEESE_MAT``-related error
Misc Improvements
-----------------
- `devel/export-dt-ini`: added more offsets for new DT versions
- `digfort`: added support for changing z-levels
- `exportlegends`: suppressed ABSTRACT_BUILDING warning
- `gui/dfstatus`: excluded logs in constructions
- `labormanager`:
- stopped assigning woodcutting jobs to elves
- "recover wounded" jobs now weighted based on altruism
- `remotefortressreader`: added support for buildings, grass, riders, and
hair/beard styles
DFHack 0.43.05-r2 DFHack 0.43.05-r2
================= =================

@ -26,6 +26,7 @@ Caldfir caldfir
Carter Bray Qartar Carter Bray Qartar
Chris Dombroski cdombroski Chris Dombroski cdombroski
Clayton Hughes Clayton Hughes
Clément Vuchener cvuchener
David Corbett dscorbett David Corbett dscorbett
David Seguin dseguin David Seguin dseguin
Deon Deon
@ -78,6 +79,7 @@ Nick Rart nickrart comestible
Nikolay Amiantov abbradar Nikolay Amiantov abbradar
nocico nocico nocico nocico
Omniclasm Omniclasm
OwnageIsMagic OwnageIsMagic
Patrik Lundell PatrikLundell Patrik Lundell PatrikLundell
Paul Fenwick pjf Paul Fenwick pjf
PeridexisErrant PeridexisErrant PeridexisErrant PeridexisErrant
@ -124,6 +126,7 @@ Travis Hoppe thoppe orthographic-pedant
txtsd txtsd txtsd txtsd
U-glouglou\\simon U-glouglou\\simon
Valentin Ochs Cat-Ion Valentin Ochs Cat-Ion
ViTuRaS ViTuRaS
Vjek Vjek
Warmist warmist Warmist warmist
Wes Malone wesQ3 Wes Malone wesQ3

@ -3621,6 +3621,8 @@ Or with auto_gears::
auto_gears=true auto_gears=true
} }
.. _luasocket:
Luasocket Luasocket
========= =========

@ -261,7 +261,7 @@ void ServerConnection::threadFn()
break; break;
} }
std::auto_ptr<uint8_t> buf(new uint8_t[header.size]); std::unique_ptr<uint8_t[]> buf(new uint8_t[header.size]);
if (!readFullBuffer(socket, buf.get(), header.size)) if (!readFullBuffer(socket, buf.get(), header.size))
{ {

@ -91,7 +91,7 @@ const char * DFHack::sa_feature(df::feature_type index)
return "Cavern"; return "Cavern";
case feature_type::magma_core_from_layer: case feature_type::magma_core_from_layer:
return "Magma sea"; return "Magma sea";
case feature_type::feature_underworld_from_layer: case feature_type::underworld_from_layer:
return "Underworld"; return "Underworld";
default: default:
return "Unknown/Error"; return "Unknown/Error";

@ -1 +1 @@
Subproject commit 3b5214bcad3349bdf3418a1dba71dbeea4a723d1 Subproject commit 860a9041a75305609643d465123a4b598140dd7f

@ -1175,6 +1175,8 @@ private:
void collect_dwarf_list() void collect_dwarf_list()
{ {
state_count.clear();
state_count.resize(NUM_STATE);
for (auto u = world->units.active.begin(); u != world->units.active.end(); ++u) for (auto u = world->units.active.begin(); u != world->units.active.end(); ++u)
{ {
@ -1373,6 +1375,8 @@ private:
if (print_debug) if (print_debug)
out.print("Dwarf \"%s\": state %s %d\n", dwarf->dwarf->name.first_name.c_str(), state_names[dwarf->state], dwarf->clear_all); out.print("Dwarf \"%s\": state %s %d\n", dwarf->dwarf->name.first_name.c_str(), state_names[dwarf->state], dwarf->clear_all);
state_count[dwarf->state]++;
// determine if dwarf has medical needs // determine if dwarf has medical needs
if (dwarf->dwarf->health && !( if (dwarf->dwarf->health && !(
// on-duty military will not necessarily break to get minor injuries attended // on-duty military will not necessarily break to get minor injuries attended
@ -1516,12 +1520,13 @@ private:
if (labor == df::unit_labor::CUTWOOD) if (labor == df::unit_labor::CUTWOOD)
{ {
auto c_id = d->dwarf->cultural_identity; if (auto culture = df::cultural_identity::find(d->dwarf->cultural_identity))
auto culture = world->cultural_identities.all[c_id]; {
auto ethics = culture->ethic[df::ethic_type::KILL_PLANT]; auto ethics = culture->ethic[df::ethic_type::KILL_PLANT];
if (ethics != df::ethic_response::NOT_APPLICABLE && ethics != df::ethic_response::REQUIRED) if (ethics != df::ethic_response::NOT_APPLICABLE && ethics != df::ethic_response::REQUIRED)
score += 10000 * (df::ethic_response::ACCEPTABLE - ethics); score += 10000 * (df::ethic_response::ACCEPTABLE - ethics);
} }
}
score -= Units::computeMovementSpeed(d->dwarf); score -= Units::computeMovementSpeed(d->dwarf);

@ -70,7 +70,7 @@ public:
display_max_rows = gps->dimy - 4 - bottom_margin; display_max_rows = gps->dimy - 4 - bottom_margin;
} }
void add(ListEntry<T> &entry) void add(const ListEntry<T> &entry)
{ {
list.push_back(entry); list.push_back(entry);
if (entry.text.length() > max_item_width) if (entry.text.length() > max_item_width)

@ -146,15 +146,22 @@ static void json_array_to_bitfield(B & bits, Json::Value & arr)
return; return;
} }
for (Json::ArrayIndex i = arr.size() - 1; i != 0; i--) for (Json::ArrayIndex i = arr.size(); i != 0; i--)
{ {
if (!arr[i - 1].isString())
{
continue;
}
std::string str(arr[i - 1].asString());
int current; int current;
if (get_bitfield_field(&current, bits, arr[i].asString())) if (get_bitfield_field(&current, bits, str))
{ {
if (!current && set_bitfield_field(&bits, arr[i].asString(), 1)) if (!current && set_bitfield_field(&bits, str, 1))
{ {
Json::Value removed; Json::Value removed;
arr.removeIndex(i, &removed); arr.removeIndex(i - 1, &removed);
} }
} }
} }

@ -721,7 +721,7 @@ command_result prospector (color_ostream &con, vector <string> & parameters)
} }
if (showSlade && blockFeatureGlobal.type != -1 && des.bits.feature_global if (showSlade && blockFeatureGlobal.type != -1 && des.bits.feature_global
&& blockFeatureGlobal.type == feature_type::feature_underworld_from_layer && blockFeatureGlobal.type == feature_type::underworld_from_layer
&& blockFeatureGlobal.main_material == 0) // stone && blockFeatureGlobal.main_material == 0) // stone
{ {
layerMats[blockFeatureGlobal.sub_material].add(global_z); layerMats[blockFeatureGlobal.sub_material].add(global_z);

@ -44,7 +44,7 @@ bool isSafe(df::coord c)
if (local_feature.type == feature_type::deep_special_tube || local_feature.type == feature_type::deep_surface_portal) if (local_feature.type == feature_type::deep_special_tube || local_feature.type == feature_type::deep_surface_portal)
return false; return false;
// And Hell *is* Hell. // And Hell *is* Hell.
if (global_feature.type == feature_type::feature_underworld_from_layer) if (global_feature.type == feature_type::underworld_from_layer)
return false; return false;
// otherwise it's safe. // otherwise it's safe.
return true; return true;

@ -465,8 +465,9 @@ int StockpileSerializer::other_mats_token ( const std::map<int, std::string> oth
void StockpileSerializer::write_general() void StockpileSerializer::write_general()
{ {
mBuffer.set_max_bins ( mPile->max_barrels ); mBuffer.set_max_bins ( mPile->max_bins );
mBuffer.set_max_wheelbarrows ( mPile->max_wheelbarrows ); mBuffer.set_max_wheelbarrows ( mPile->max_wheelbarrows );
mBuffer.set_max_barrels ( mPile->max_barrels );
mBuffer.set_use_links_only ( mPile->use_links_only ); mBuffer.set_use_links_only ( mPile->use_links_only );
mBuffer.set_unknown1 ( mPile->settings.unk1 ); mBuffer.set_unknown1 ( mPile->settings.unk1 );
mBuffer.set_allow_inorganic ( mPile->settings.allow_inorganic ); mBuffer.set_allow_inorganic ( mPile->settings.allow_inorganic );

@ -1 +1 @@
Subproject commit 3baa24fec93461218b5b658de94884ebff0a0b23 Subproject commit 09cf8dde929e0478a869fa09ec329a27c9631113