diff options
Diffstat (limited to 'Stars45/TacticalAI.cpp')
-rw-r--r-- | Stars45/TacticalAI.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Stars45/TacticalAI.cpp b/Stars45/TacticalAI.cpp index 0e61015..5d0c353 100644 --- a/Stars45/TacticalAI.cpp +++ b/Stars45/TacticalAI.cpp @@ -128,7 +128,7 @@ TacticalAI::ExecFrame(double secs) ship_ai->SetNavPoint(navpt); if (carrier_ai) - carrier_ai->ExecFrame(secs); + carrier_ai->ExecFrame(secs); exec_time += exec_period; } @@ -298,7 +298,7 @@ TacticalAI::ProcessOrders() roe = NONE; ship_ai->DropTarget(10); - + if (!ship->GetInbound()) { RadioMessage* msg = 0; Ship* controller = ship->GetController(); @@ -349,7 +349,7 @@ TacticalAI::ProcessOrders() return true; } - // if we had an action before, this must be a "cancel orders" + // if we had an action before, this must be a "cancel orders" else if (action) { ClearRadioOrders(); } @@ -653,7 +653,7 @@ TacticalAI::SelectTargetOpportunity() if (rogue || tgt_ok) { if (c_ship && c_ship != ship && !c_ship->InTransition()) { - if (c_ship->Class() < Ship::DESTROYER || + if (c_ship->Class() < Ship::DESTROYER || (c_ship->Class() >= Ship::MINE && c_ship->Class() <= Ship::DEFSAT)) { // found an enemy, check distance: double dist = (ship->Location() - c_ship->Location()).length(); @@ -684,7 +684,7 @@ TacticalAI::SelectTargetOpportunity() Ship* ward = ship_ai->GetWard(); if ((c_shot->IsTracking(ward) || c_shot->IsTracking(ship)) && - (!current_shot_target->IsTracking(ward) || + (!current_shot_target->IsTracking(ward) || !current_shot_target->IsTracking(ship))) { current_shot_target = c_shot; target_dist = dist; @@ -719,9 +719,9 @@ TacticalAI::SelectTargetOpportunity() int c_iff = contact->GetIFF(ship); bool rogue = c_ship->IsRogue(); - bool tgt_ok = c_ship != ship && - c_iff > 0 && - c_iff != ship->GetIFF() && + bool tgt_ok = c_ship != ship && + c_iff > 0 && + c_iff != ship->GetIFF() && !c_ship->InTransition(); if (rogue || tgt_ok) { @@ -745,7 +745,7 @@ TacticalAI::SelectTargetOpportunity() // prefer targets that are threatening that ward: if (potential_target && ward_threats.size() && !ward_threats.contains((Ship*)potential_target)) { target_dist *= 2; - + ListIter<Ship> iter = ward_threats; while (++iter) { Ship* threat = iter.value(); @@ -857,7 +857,7 @@ TacticalAI::FindThreat() while (++iter) { Contact* contact = iter.value(); - if (contact->Threat(ship) && + if (contact->Threat(ship) && (Game::GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) { if (contact->GetShot()) { |