diff --git a/CMakeLists.txt b/CMakeLists.txt index 79889dcb0..6faa01870 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,7 @@ endif() # set up versioning. set(DF_VERSION "0.43.05") -SET(DFHACK_RELEASE "r2") +SET(DFHACK_RELEASE "r3") SET(DFHACK_PRERELEASE FALSE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") diff --git a/NEWS.rst b/NEWS.rst index 9d8b05a78..e55ca92c5 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -36,6 +36,47 @@ Changelog .. contents:: :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 ================= diff --git a/docs/Authors.rst b/docs/Authors.rst index 128d327ba..a693646bf 100644 --- a/docs/Authors.rst +++ b/docs/Authors.rst @@ -26,6 +26,7 @@ Caldfir caldfir Carter Bray Qartar Chris Dombroski cdombroski Clayton Hughes +ClĂ©ment Vuchener cvuchener David Corbett dscorbett David Seguin dseguin Deon @@ -78,6 +79,7 @@ Nick Rart nickrart comestible Nikolay Amiantov abbradar nocico nocico Omniclasm +OwnageIsMagic OwnageIsMagic Patrik Lundell PatrikLundell Paul Fenwick pjf PeridexisErrant PeridexisErrant @@ -124,6 +126,7 @@ Travis Hoppe thoppe orthographic-pedant txtsd txtsd U-glouglou\\simon Valentin Ochs Cat-Ion +ViTuRaS ViTuRaS Vjek Warmist warmist Wes Malone wesQ3 diff --git a/docs/Lua API.rst b/docs/Lua API.rst index d9bbfed55..66c2a5a07 100644 --- a/docs/Lua API.rst +++ b/docs/Lua API.rst @@ -3621,6 +3621,8 @@ Or with auto_gears:: auto_gears=true } +.. _luasocket: + Luasocket ========= diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp index 05fd141f2..9cd017993 100644 --- a/library/RemoteServer.cpp +++ b/library/RemoteServer.cpp @@ -261,7 +261,7 @@ void ServerConnection::threadFn() break; } - std::auto_ptr buf(new uint8_t[header.size]); + std::unique_ptr buf(new uint8_t[header.size]); if (!readFullBuffer(socket, buf.get(), header.size)) { diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index af2cd5183..2b2311a7c 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -91,7 +91,7 @@ const char * DFHack::sa_feature(df::feature_type index) return "Cavern"; case feature_type::magma_core_from_layer: return "Magma sea"; - case feature_type::feature_underworld_from_layer: + case feature_type::underworld_from_layer: return "Underworld"; default: return "Unknown/Error"; diff --git a/library/xml b/library/xml index 3b5214bca..860a9041a 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 3b5214bcad3349bdf3418a1dba71dbeea4a723d1 +Subproject commit 860a9041a75305609643d465123a4b598140dd7f diff --git a/plugins/labormanager/labormanager.cpp b/plugins/labormanager/labormanager.cpp index d7d4ffc6b..1a5323d8a 100644 --- a/plugins/labormanager/labormanager.cpp +++ b/plugins/labormanager/labormanager.cpp @@ -1175,6 +1175,8 @@ private: 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) { @@ -1373,6 +1375,8 @@ private: 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); + state_count[dwarf->state]++; + // determine if dwarf has medical needs if (dwarf->dwarf->health && !( // on-duty military will not necessarily break to get minor injuries attended @@ -1516,11 +1520,12 @@ private: if (labor == df::unit_labor::CUTWOOD) { - auto c_id = d->dwarf->cultural_identity; - auto culture = world->cultural_identities.all[c_id]; - auto ethics = culture->ethic[df::ethic_type::KILL_PLANT]; - if (ethics != df::ethic_response::NOT_APPLICABLE && ethics != df::ethic_response::REQUIRED) - score += 10000 * (df::ethic_response::ACCEPTABLE - ethics); + if (auto culture = df::cultural_identity::find(d->dwarf->cultural_identity)) + { + auto ethics = culture->ethic[df::ethic_type::KILL_PLANT]; + if (ethics != df::ethic_response::NOT_APPLICABLE && ethics != df::ethic_response::REQUIRED) + score += 10000 * (df::ethic_response::ACCEPTABLE - ethics); + } } score -= Units::computeMovementSpeed(d->dwarf); diff --git a/plugins/listcolumn.h b/plugins/listcolumn.h index 9914c8ea7..4e4815b69 100644 --- a/plugins/listcolumn.h +++ b/plugins/listcolumn.h @@ -70,7 +70,7 @@ public: display_max_rows = gps->dimy - 4 - bottom_margin; } - void add(ListEntry &entry) + void add(const ListEntry &entry) { list.push_back(entry); if (entry.text.length() > max_item_width) diff --git a/plugins/orders.cpp b/plugins/orders.cpp index 53c1844ac..4a2e3b0c0 100644 --- a/plugins/orders.cpp +++ b/plugins/orders.cpp @@ -146,15 +146,22 @@ static void json_array_to_bitfield(B & bits, Json::Value & arr) 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; - if (get_bitfield_field(¤t, bits, arr[i].asString())) + if (get_bitfield_field(¤t, bits, str)) { - if (!current && set_bitfield_field(&bits, arr[i].asString(), 1)) + if (!current && set_bitfield_field(&bits, str, 1)) { Json::Value removed; - arr.removeIndex(i, &removed); + arr.removeIndex(i - 1, &removed); } } } diff --git a/plugins/prospector.cpp b/plugins/prospector.cpp index 522630afe..32e360a3a 100644 --- a/plugins/prospector.cpp +++ b/plugins/prospector.cpp @@ -721,7 +721,7 @@ command_result prospector (color_ostream &con, vector & parameters) } 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 { layerMats[blockFeatureGlobal.sub_material].add(global_z); diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp index 314259fd4..c2479bedc 100644 --- a/plugins/reveal.cpp +++ b/plugins/reveal.cpp @@ -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) return false; // 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; // otherwise it's safe. return true; diff --git a/plugins/stockpiles/StockpileSerializer.cpp b/plugins/stockpiles/StockpileSerializer.cpp index fa3d648ba..e9a8143a5 100644 --- a/plugins/stockpiles/StockpileSerializer.cpp +++ b/plugins/stockpiles/StockpileSerializer.cpp @@ -465,8 +465,9 @@ int StockpileSerializer::other_mats_token ( const std::map oth 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_barrels ( mPile->max_barrels ); mBuffer.set_use_links_only ( mPile->use_links_only ); mBuffer.set_unknown1 ( mPile->settings.unk1 ); mBuffer.set_allow_inorganic ( mPile->settings.allow_inorganic ); diff --git a/scripts b/scripts index 3baa24fec..09cf8dde9 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 3baa24fec93461218b5b658de94884ebff0a0b23 +Subproject commit 09cf8dde929e0478a869fa09ec329a27c9631113