From 9dc199dac3c1cc5f0f0025a307145372eb653c19 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Tue, 25 Oct 2022 15:01:57 -0700 Subject: [PATCH] Apply suggestions from code review --- plugins/spectate/spectate.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/plugins/spectate/spectate.cpp b/plugins/spectate/spectate.cpp index 2295422c5..5f720806c 100644 --- a/plugins/spectate/spectate.cpp +++ b/plugins/spectate/spectate.cpp @@ -184,7 +184,7 @@ DFhackCExport command_result plugin_onupdate(color_ostream &out) { } } if (failsafe >= 10) { - out.printerr("spectate encountered a problem dismissing a popup!"); + out.printerr("spectate encountered a problem dismissing a popup!\n"); } if (disengage_enabled && !World::ReadPauseState()) { if (our_dorf && our_dorf->id != df::global::ui->follow_unit) { @@ -304,15 +304,14 @@ void onTick(color_ostream& out, void* ptr) { dwarves.push_back(unit); } std::uniform_int_distribution follow_any(0, dwarves.size() - 1); - // if you're looking at a warning about a local address escaping, it means the unit* from dwarves (which aren't local) - our_dorf = dwarves[follow_any(RNG)]; - df::global::ui->follow_unit = our_dorf->id; - job_watched = our_dorf->job.current_job; - following_dwarf = true; - if (!job_watched) { - timestamp = tick; - } - + // if you're looking at a warning about a local address escaping, it means the unit* from dwarves (which aren't local) + our_dorf = dwarves[follow_any(RNG)]; + df::global::ui->follow_unit = our_dorf->id; + job_watched = our_dorf->job.current_job; + following_dwarf = true; + if (!job_watched) { + timestamp = tick; + } } }