From ca481fc69f177686a01fe3c89f59532c7ba2ac66 Mon Sep 17 00:00:00 2001 From: ViTuRaS Date: Mon, 28 Aug 2017 22:33:24 +0200 Subject: [PATCH 01/15] max_barrels was serialized on max_bins position When I save and load stockpile settings with stockpile management plugin, then saved barrels count will be loaded in bins and barrels are zero. So I think this change should correct it. --- plugins/stockpiles/StockpileSerializer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ); From d3f3ebf77868d344c09b911137c8e26e4c92c2b3 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Wed, 4 Oct 2017 14:37:04 -0500 Subject: [PATCH 02/15] auto_ptr is deprecated - use unique_ptr instead --- library/RemoteServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp index df65e8e5a..bc30daff3 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)) { From c080da3750d923bd546f94c40c0a1b9ee88f28cc Mon Sep 17 00:00:00 2001 From: Quietust Date: Sun, 8 Oct 2017 19:54:51 -0600 Subject: [PATCH 03/15] listcolumn - adjust add(ListEntry) to take const ref, more compatible on Linux --- plugins/listcolumn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From cc595d7a4ed3d72f654e4474fd62563f9930983e Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Mon, 16 Oct 2017 14:01:23 -0500 Subject: [PATCH 04/15] Fix fencepost error in orders import. Fixes #1177. --- plugins/orders.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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); } } } From 33a43c5bfd0bebd902b4194ed077e9666df49f32 Mon Sep 17 00:00:00 2001 From: Quietust Date: Sat, 4 Nov 2017 07:50:47 -0600 Subject: [PATCH 05/15] update structures --- library/modules/Maps.cpp | 2 +- library/xml | 2 +- plugins/prospector.cpp | 2 +- plugins/reveal.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 3322beb2e..888f24622 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 3322beb2e7f4b28ff8e573e9bec738c77026b8e9 +Subproject commit 888f24622990c11db5c392f5e241e0de28d2bb9e 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; From e06644cdf4320732922b2329f5bdadbf39f30922 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Thu, 23 Nov 2017 10:55:37 -0600 Subject: [PATCH 06/15] Fix labormanager crash when a dwarf doesn't have a cultural identity --- plugins/labormanager/labormanager.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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); From 111df1312bac8ea9bb0a60bd572f82493d6eedac Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 15:50:58 -0500 Subject: [PATCH 07/15] Update xml to 1cdab5a (last for 0.43.05) --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 888f24622..1cdab5a16 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 888f24622990c11db5c392f5e241e0de28d2bb9e +Subproject commit 1cdab5a16467c73080553e94a651bbc2b48380a6 From 2473476f98717c04191a23582adde6140f0ae57e Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 15:54:34 -0500 Subject: [PATCH 08/15] Update Authors.rst (#1156) --- docs/Authors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Authors.rst b/docs/Authors.rst index 128d327ba..cb915e036 100644 --- a/docs/Authors.rst +++ b/docs/Authors.rst @@ -124,6 +124,7 @@ Travis Hoppe thoppe orthographic-pedant txtsd txtsd U-glouglou\\simon Valentin Ochs Cat-Ion +ViTuRaS ViTuRaS Vjek Warmist warmist Wes Malone wesQ3 From a3288b4b05e724551b9ae40a1caacb553b4c7a50 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 15:54:45 -0500 Subject: [PATCH 09/15] Update Authors.rst (dfhack/scripts#32) --- docs/Authors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Authors.rst b/docs/Authors.rst index cb915e036..948d956ba 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 From 5795a370bc7f08ce5c3073fc7038de28c439c29f Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 16:01:27 -0500 Subject: [PATCH 10/15] Update xml again to fix GCC build error --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 1cdab5a16..860a9041a 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 1cdab5a16467c73080553e94a651bbc2b48380a6 +Subproject commit 860a9041a75305609643d465123a4b598140dd7f From c546e5e52c9a1940ae576c4139d77522b3a387a1 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 16:06:19 -0500 Subject: [PATCH 11/15] Update Authors.rst (dfhack/scripts#31) --- docs/Authors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Authors.rst b/docs/Authors.rst index 948d956ba..a693646bf 100644 --- a/docs/Authors.rst +++ b/docs/Authors.rst @@ -79,6 +79,7 @@ Nick Rart nickrart comestible Nikolay Amiantov abbradar nocico nocico Omniclasm +OwnageIsMagic OwnageIsMagic Patrik Lundell PatrikLundell Paul Fenwick pjf PeridexisErrant PeridexisErrant From 1b706bc1626c27475f728890bff524d07d4f1d36 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 16:34:22 -0500 Subject: [PATCH 12/15] Add anchor for luasocket --- docs/Lua API.rst | 2 ++ 1 file changed, 2 insertions(+) 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 ========= From fb940b8836601f6a9a38807e04e3dc79496f9173 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 16:34:28 -0500 Subject: [PATCH 13/15] Update NEWS.rst --- NEWS.rst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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 ================= From e2f705c76d34e858023e9a77071a2184a27bb3b9 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 23 Nov 2017 16:38:05 -0500 Subject: [PATCH 14/15] Update version in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}") From 69eb10a3e552bba0c9185737dd00fc0af4e369e3 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 24 Nov 2017 23:40:58 -0500 Subject: [PATCH 15/15] Update scripts --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 3baa24fec..09cf8dde9 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 3baa24fec93461218b5b658de94884ebff0a0b23 +Subproject commit 09cf8dde929e0478a869fa09ec329a27c9631113