Merge pull request #840 from expwnent/develop

Fix persistent histfig crashbug.
develop
expwnent 2016-03-10 08:58:08 -05:00
commit 5fe618ade5
3 changed files with 8 additions and 1 deletions

@ -70,6 +70,7 @@ 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

@ -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;
}

@ -1 +1 @@
Subproject commit 746e1ced2b34b4f433e816954d1c9cfbb527a6b5
Subproject commit 90645ebd8e8433196d695a478e3d6c9a32add21d