diff --git a/source/Engine.cpp b/source/Engine.cpp index b00a3881597d..a98f1f43d06f 100644 --- a/source/Engine.cpp +++ b/source/Engine.cpp @@ -842,8 +842,17 @@ void Engine::Step(bool isActive) info.SetString("target government", target->GetGovernment()->GetName()); info.SetString("mission target", target->GetPersonality().IsTarget() ? "(mission target)" : ""); + // Only update the "active" state shown for the target if it is + // in the current system and targetable, or owned by the player. int targetType = RadarType(*target, step); - info.SetOutlineColor(GetTargetOutlineColor(targetType)); + const bool blinking = targetType == Radar::BLINK; + if(!blinking && ((target->GetSystem() == player.GetSystem() && target->IsTargetable()) || target->IsYours())) + lastTargetType = targetType; + if(blinking) + info.SetOutlineColor(GetTargetOutlineColor(Radar::BLINK)); + else + info.SetOutlineColor(GetTargetOutlineColor(lastTargetType)); + if(target->GetSystem() == player.GetSystem() && target->IsTargetable()) { info.SetBar("target shields", target->Shields()); diff --git a/source/Engine.h b/source/Engine.h index 31ff7818c83d..ebb271acf437 100644 --- a/source/Engine.h +++ b/source/Engine.h @@ -245,6 +245,9 @@ class Engine { Point targetVector; Point targetUnit; int targetSwizzle = -1; + // Represents the state of the currently targeted ship when it was last seen, + // so the target display does not show updates to its state the player should not be aware of. + int lastTargetType = 0; EscortDisplay escorts; AmmoDisplay ammoDisplay; std::vector outlines;