Small bug fix for autolabor crashing on script created creatures.

develop
Warmist 2013-10-20 21:50:22 +03:00
parent 0dff26aa23
commit d179812c22
1 changed files with 1 additions and 0 deletions

@ -1007,6 +1007,7 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
int noble_penalty = 0; int noble_penalty = 0;
df::historical_figure* hf = df::historical_figure::find(dwarfs[dwarf]->hist_figure_id); df::historical_figure* hf = df::historical_figure::find(dwarfs[dwarf]->hist_figure_id);
if(hf!=NULL) //can be NULL. E.g. script created citizens
for (int i = 0; i < hf->entity_links.size(); i++) for (int i = 0; i < hf->entity_links.size(); i++)
{ {
df::histfig_entity_link* hfelink = hf->entity_links.at(i); df::histfig_entity_link* hfelink = hf->entity_links.at(i);