diff --git a/CMakeLists.txt b/CMakeLists.txt index 34e60736e..b6fe84032 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ endif() # set up versioning. set(DF_VERSION "0.42.06") -SET(DFHACK_RELEASE "alpha1") +SET(DFHACK_RELEASE "alpha2") SET(DFHACK_PRERELEASE TRUE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") diff --git a/NEWS.rst b/NEWS.rst index 89d08706f..54b986e73 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -70,10 +70,12 @@ New Features Fixes ----- +- Fixed a crash bug caused by the historical figures DFHack uses to store persistent data. - More plugins should recognize non-dwarf citizens - Fixed a possible crash from cloning jobs - `confirm` note-delete: No longer interferes with name entry - `exportlegends`: Handles entities without specific races, and a few other fixes for things new to v0.42 +- `fastdwarf`: Fixed a bug involving teleporting mothers but not the babies they're holding. - `gaydar`: Fixed text display on OS X/Linux and failure with soul-less creatures - `manipulator`: diff --git a/library/include/df/custom/building_handler.methods.inc b/library/include/df/custom/building_handler.methods.inc new file mode 100644 index 000000000..c160f5470 --- /dev/null +++ b/library/include/df/custom/building_handler.methods.inc @@ -0,0 +1 @@ +friend struct df::world; diff --git a/library/include/df/custom/machine_handler.methods.inc b/library/include/df/custom/machine_handler.methods.inc new file mode 100644 index 000000000..c160f5470 --- /dev/null +++ b/library/include/df/custom/machine_handler.methods.inc @@ -0,0 +1 @@ +friend struct df::world; diff --git a/library/modules/EventManager.cpp b/library/modules/EventManager.cpp index 6384e897c..9133b48bb 100644 --- a/library/modules/EventManager.cpp +++ b/library/modules/EventManager.cpp @@ -16,6 +16,7 @@ #include "df/general_ref_type.h" #include "df/general_ref_unit_workerst.h" #include "df/global_objects.h" +#include "df/historical_figure.h" #include "df/interaction.h" #include "df/item.h" #include "df/item_actual.h" @@ -296,6 +297,11 @@ void DFHack::EventManager::onStateChange(color_ostream& out, state_change_event for ( size_t a = 0; a < EventType::EVENT_MAX; a++ ) { eventLastTick[a] = -1;//-1000000; } + for ( size_t a = 0; a < df::global::world->history.figures.size(); a++ ) { + df::historical_figure* unit = df::global::world->history.figures[a]; + if ( unit->id < 0 && unit->name.language < 0 ) + unit->name.language = 0; + } gameLoaded = true; } diff --git a/library/xml b/library/xml index 49e1324f4..90645ebd8 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 49e1324f415056f3ae39cb32328e3351a3a2b383 +Subproject commit 90645ebd8e8433196d695a478e3d6c9a32add21d diff --git a/plugins/fastdwarf.cpp b/plugins/fastdwarf.cpp index bbfa5d1d8..964e2906e 100644 --- a/plugins/fastdwarf.cpp +++ b/plugins/fastdwarf.cpp @@ -10,6 +10,7 @@ #include "df/unit.h" #include "df/unit_action.h" #include "df/map_block.h" +#include "df/units_other_id.h" using std::string; using std::vector; @@ -97,6 +98,17 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out ) // move unit to destination unit->pos = unit->path.dest; unit->path.path.clear(); + + //move unit's riders(including babies) to destination + if (unit->flags1.bits.ridden) + { + for (size_t j = 0; j < world->units.other[units_other_id::ANY_RIDER].size(); j++) + { + df::unit *rider = world->units.other[units_other_id::ANY_RIDER][j]; + if (rider->relations.rider_mount_id == unit->id) + rider->pos = unit->pos; + } + } } while (0); if (enable_fastdwarf)