| 195 | } |
| 196 | |
| 197 | void add_and_follow(color_ostream &out, df::unit *unit) { |
| 198 | // if we're currently following a unit, add it to the history if it's not already there |
| 199 | if (plotinfo->follow_unit > -1 && plotinfo->follow_unit != get_cur_unit_id()) { |
| 200 | DEBUG(cycle,out).print("currently following unit {} that is not in history; adding\n", plotinfo->follow_unit); |
| 201 | add_to_history(out, plotinfo->follow_unit); |
| 202 | } |
| 203 | |
| 204 | int32_t id = unit->id; |
| 205 | add_to_history(out, id); |
| 206 | DEBUG(cycle,out).print("now following unit {}: {}\n", id, DF2CONSOLE(Units::getReadableName(unit))); |
| 207 | Gui::revealInDwarfmodeMap(Units::getPosition(unit), false, World::ReadPauseState()); |
| 208 | plotinfo->follow_item = -1; |
| 209 | plotinfo->follow_unit = id; |
| 210 | } |
| 211 | |
| 212 | void scan_back(color_ostream &out) { |
| 213 | if (history.empty() || offset >= history.size()-1) { |
no test coverage detected