EventManager: make REPORT events only trigger for new reports, not ones that already exist in the save.

develop
expwnent 2014-11-14 22:07:48 -05:00
parent c7e0a13505
commit 4464d7318d
2 changed files with 4 additions and 0 deletions

@ -1,6 +1,7 @@
DFHack Future
Internals:
EventManager should handle INTERACTION triggers a little better. It still can get confused about who did what but only rarely.
EventManager should no longer trigger REPORT events for old reports after loading a save.
lua/persist-table.lua: a convenient way of using persistent tables of arbitrary structure and dimension in Lua
Fixes:
full-heal: Updated with proper argument handling.

@ -286,6 +286,9 @@ void DFHack::EventManager::onStateChange(color_ostream& out, state_change_event
}
}
lastReport = -1;
if ( df::global::world->status.reports.size() > 0 ) {
lastReport = df::global::world->status.reports[df::global::world->status.reports.size()-1]->id;
}
lastReportUnitAttack = -1;
lastReportInteraction = -1;
reportToRelevantUnitsTime = -1;