Skip to content

Commit

Permalink
Fix persistent histfig crashbug.
Browse files Browse the repository at this point in the history
  • Loading branch information
expwnent committed Mar 10, 2016
1 parent cbb4275 commit fd132d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Fixes

- `showmood`: Fixed name display on OS X/Linux

- Fixed a crash bug caused by the historical figures DFHack uses to store persistent data.

Misc Improvements
-----------------
- `autolabor`, `autohauler`, `manipulator`: Added support for new jobs/labors/skills
Expand Down
6 changes: 6 additions & 0 deletions library/modules/EventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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->name.language < 0 )
unit->name.language = 0;
}

gameLoaded = true;
}
Expand Down
2 changes: 1 addition & 1 deletion library/xml
Submodule xml updated 1 files
+1 −1 df.language.xml

0 comments on commit fd132d3

Please sign in to comment.