summaryrefslogtreecommitdiffhomepage
path: root/Stars45/FighterAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/FighterAI.cpp')
-rw-r--r--Stars45/FighterAI.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp
index 3cb2776..b6a720a 100644
--- a/Stars45/FighterAI.cpp
+++ b/Stars45/FighterAI.cpp
@@ -174,7 +174,7 @@ FighterAI::ExecFrame(double s)
ship->CloneCam(landing_cam);
ship->MoveTo(dst);
-
+
if (!ship->IsAirborne()) {
ship->SetVelocity(carrier->Velocity());
}
@@ -193,8 +193,8 @@ FighterAI::ExecFrame(double s)
else {
Instruction* orders = ship->GetRadioOrders();
- if (orders &&
- (orders->Action() == RadioMessage::WEP_HOLD ||
+ if (orders &&
+ (orders->Action() == RadioMessage::WEP_HOLD ||
orders->Action() == RadioMessage::FORM_UP)) {
form_up = true;
rtb_code = 0;
@@ -301,7 +301,7 @@ FighterAI::FindObjective()
}
// not inbound yet, check for RTB order:
- else {
+ else {
Instruction* orders = (Instruction*) ship->GetRadioOrders();
int action = 0;
@@ -659,7 +659,7 @@ FighterAI::Navigator()
z_shift = 0;
hold = false;
- if ((ship->GetElement() && ship->GetElement()->GetHoldTime() > 0) ||
+ if ((ship->GetElement() && ship->GetElement()->GetHoldTime() > 0) ||
(navpt && navpt->Status() == Instruction::COMPLETE && navpt->HoldTime() > 0))
hold = true;
@@ -860,7 +860,7 @@ FighterAI::ThrottleControl()
throttle = 0;
// holding short?
- if (inbound->Approach() == 0 && !inbound->Cleared() &&
+ if (inbound->Approach() == 0 && !inbound->Cleared() &&
distance < 2000 && !ship->IsAirborne())
desired = 0;
@@ -1038,7 +1038,7 @@ FighterAI::ThrottleControl()
throttle = 50;
}
}
-
+
else if (ward) {
double d = (ship->Location() - ward->Location()).length();
@@ -1221,7 +1221,7 @@ FighterAI::SeekTarget()
result.brake = 1;
result.stop = 1;
}
-
+
return result;
}
@@ -1264,7 +1264,7 @@ FighterAI::SeekTarget()
result.brake = 1;
result.stop = 1;
}
-
+
else if (!inbound->Cleared() && distance < 2000) {
ship->SetDirectorInfo(Game::GetText("ai.hold-final"));
result = Steer();
@@ -1321,7 +1321,7 @@ FighterAI::SeekTarget()
s.pitch = -0.1;
if (objective.x > 0) s.yaw = 0.1;
- else s.yaw = -0.1;
+ else s.yaw = -0.1;
return s;
}
@@ -1459,7 +1459,7 @@ FighterAI::Seek(const Point& point)
if (point.z > 0.0f) {
az[0] = atan2(fabs(point.x), point.z) * seek_gain;
el[0] = atan2(fabs(point.y), point.z) * seek_gain;
-
+
if (point.x < 0) az[0] = -az[0];
if (point.y > 0) el[0] = -el[0];
@@ -1628,7 +1628,7 @@ FighterAI::EvadeThreat()
else {
evading = true;
-
+
if (target != nullptr) {
if (target == threat) {
if (target->Type() == SimObject::SIM_SHIP) {
@@ -1753,7 +1753,7 @@ FighterAI::FireControl()
double dy = fabs(objective.y / distance);
if (primary->GetFiringOrders() == Weapon::MANUAL &&
- dx < gun_basket && dy < gun_basket &&
+ dx < gun_basket && dy < gun_basket &&
distance > dsgn_primary->min_range &&
distance < dsgn_primary->max_range &&
!primary->IsBlockedFriendly())
@@ -1785,7 +1785,7 @@ FighterAI::FireControl()
extra_time = 10;
s_range = 0.75;
}
-
+
else if (!tgt_ship->IsDropship()) {
extra_time = 0.5 * factor + 0.5;
s_range = 0.9;
@@ -1838,8 +1838,8 @@ FighterAI::CalcDefensePerimeter(Ship* starship)
while (++w_iter) {
Weapon* weapon = w_iter.value();
- if (weapon->Ammo() &&
- weapon->GetTarget() == ship &&
+ if (weapon->Ammo() &&
+ weapon->GetTarget() == ship &&
!weapon->IsBlockedFriendly()) {
double range = weapon->Design()->max_range * 1.2;