summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Ship.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Ship.cpp')
-rw-r--r--Stars45/Ship.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/Stars45/Ship.cpp b/Stars45/Ship.cpp
index bd03c55..31157b3 100644
--- a/Stars45/Ship.cpp
+++ b/Stars45/Ship.cpp
@@ -262,7 +262,7 @@ Ship::Ship(const char* ship_name, const char* reg_num, ShipDesign* ship_dsn, int
shieldRep = new(__FILE__,__LINE__) ShieldRep;
shieldRep->UseModel(design->shield_model);
}
-
+
systems.append(shield);
}
@@ -1243,7 +1243,7 @@ Ship::NumContacts() const
{
// cast-away const:
return ((Ship*)this)->ContactList().size();
-}
+}
List<Contact>&
Ship::ContactList()
@@ -1552,8 +1552,8 @@ Ship::HitBy(Shot* shot, Point& impact)
if (hit_type) {
if (shot->Damage() > 0) {
DWORD flash = Explosion::HULL_FLASH;
-
- if ((hit_type & HIT_SHIELD) != 0)
+
+ if ((hit_type & HIT_SHIELD) != 0)
flash = Explosion::SHIELD_FLASH;
sim->CreateExplosion(impact, Velocity(), flash, 0.3f * scale, scale, region);
@@ -1570,7 +1570,7 @@ Ship::HitBy(Shot* shot, Point& impact)
if (dlen < (damage_radius + Radius())) {
if (seeker && seeker->Overshot()) {
dscale = 1.0 - (dlen / (damage_radius + Radius()));
-
+
if (dscale > 1)
dscale = 1;
@@ -1917,7 +1917,7 @@ Ship::SetNetSystemStatus(System* system, int status, int power, int reactor, dou
if (c->Status() < Component::NOMINAL && c->Availability() < 75) {
if (c->SpareCount() &&
c->ReplaceTime() <= 300 &&
- (c->Availability() < 50 ||
+ (c->Availability() < 50 ||
c->ReplaceTime() < c->RepairTime())) {
c->Replace();
@@ -2144,7 +2144,7 @@ Ship::CommandMode()
if (!dir || dir->Type() != ShipCtrl::DIR_TYPE) {
const char* msg = "Captain on the bridge";
RadioVox* vox = new(__FILE__,__LINE__) RadioVox(0, "1", msg);
-
+
if (vox) {
vox->AddPhrase(msg);
@@ -2160,7 +2160,7 @@ Ship::CommandMode()
else {
const char* msg = "Exec, you have the conn";
RadioVox* vox = new(__FILE__,__LINE__) RadioVox(0, "1", msg);
-
+
if (vox) {
vox->AddPhrase(msg);
@@ -2226,7 +2226,7 @@ Ship::SetNavptStatus(Instruction* navpt, int status)
}
navpt->SetStatus(status);
-
+
if (status == Instruction::COMPLETE)
sim->ProcessEventTrigger(MissionEvent::TRIGGER_NAVPT, 0, Name(), GetNavIndex(navpt));
@@ -2400,7 +2400,7 @@ Ship::ExecFrame(double seconds)
return;
}
- if (flight_phase == LAUNCH ||
+ if (flight_phase == LAUNCH ||
(flight_phase == TAKEOFF && AltitudeAGL() > Radius())) {
SetFlightPhase(ACTIVE);
}
@@ -2546,7 +2546,7 @@ Ship::ExecSensors(double seconds)
if (sensor)
sensor->ExecFrame(seconds);
- // can we still see our target?
+ // can we still see our target?
if (target) {
int target_found = 0;
ListIter<Contact> c_iter = ContactList();
@@ -2565,7 +2565,7 @@ Ship::ExecSensors(double seconds)
if (!target_found)
DropTarget();
- }
+ }
}
// +--------------------------------------------------------------------+
@@ -2580,7 +2580,7 @@ Ship::ExecNavFrame(double seconds)
if (navsys) {
navsys->ExecFrame(seconds);
-
+
if (navsys->AutoNavEngaged()) {
if (dir && dir->Type() == NavAI::DIR_TYPE) {
NavAI* navai = (NavAI*) dir;
@@ -2603,21 +2603,21 @@ Ship::ExecNavFrame(double seconds)
if (navpt && !auto_pilot) {
if (navpt->Region() == GetRegion()) {
double distance = 0;
-
+
Point npt = navpt->Location();
if (navpt->Region())
npt += navpt->Region()->Location();
-
+
Sim* sim = Sim::GetSim();
if (sim->GetActiveRegion())
npt -= sim->GetActiveRegion()->Location();
npt = npt.OtherHand();
-
+
// distance from self to navpt:
distance = Point(npt - Location()).length();
-
+
if (distance < 10 * Radius())
SetNavptStatus(navpt, Instruction::COMPLETE);
}
@@ -2788,7 +2788,7 @@ Ship::ExecSystems(double seconds)
CycleSecondary();
- // do not winchester-cycle to an A2G missile type,
+ // do not winchester-cycle to an A2G missile type,
// or a missile that is also out of ammo,
// keep going!
@@ -2831,9 +2831,9 @@ Ship::ExecSystems(double seconds)
if (cockpit) {
Solid* solid = (Solid*) rep;
- Point cpos = cam.Pos() +
+ Point cpos = cam.Pos() +
cam.vrt() * bridge_vec.x +
- cam.vpn() * bridge_vec.y +
+ cam.vpn() * bridge_vec.y +
cam.vup() * bridge_vec.z;
cockpit->MoveTo(cpos);
@@ -3033,9 +3033,9 @@ Ship::DockFrame(double seconds)
if (cockpit && !cockpit->Hidden()) {
Solid* solid = (Solid*) rep;
- Point cpos = cam.Pos() +
+ Point cpos = cam.Pos() +
cam.vrt() * bridge_vec.x +
- cam.vpn() * bridge_vec.y +
+ cam.vpn() * bridge_vec.y +
cam.vup() * bridge_vec.z;
cockpit->MoveTo(cpos);
@@ -3231,7 +3231,7 @@ Ship::SelectDetail(double seconds)
scene->DelGraphic(g);
}
}
-
+
// switch to new rep:
detail_level = new_level;
rep = detail.GetRep(detail_level);
@@ -3410,7 +3410,7 @@ Ship::EnableShadows(bool enable)
{
for (int i = 0; i < detail.NumModels(detail_level); i++) {
Graphic* g = detail.GetRep(detail_level, i);
-
+
if (g->IsSolid()) {
Solid* s = (Solid*) g;
@@ -3614,7 +3614,7 @@ Ship::TimeSkip()
transition_type = TRANSITION_TIME_SKIP;
transition_loc = Location() + Heading() * (Velocity().length() * 4);
// 2500; //(8*Radius());
-
+
if (rand() < 16000)
transition_loc += BeamLine() * (2.5*Radius());
else
@@ -4390,7 +4390,7 @@ Ship::GetPrimaryDesign() const
{
if (weapons.size() > primary)
return (WeaponDesign*) weapons[primary]->GetSelected()->Design();
- return 0;
+ return 0;
}
WeaponDesign*
@@ -4398,7 +4398,7 @@ Ship::GetSecondaryDesign() const
{
if (weapons.size() > secondary)
return (WeaponDesign*) weapons[secondary]->GetSelected()->Design();
- return 0;
+ return 0;
}
Weapon*
@@ -4407,13 +4407,13 @@ Ship::GetDecoy() const
return decoy;
}
-List<Shot>&
+List<Shot>&
Ship::GetActiveDecoys()
{
return decoy_list;
}
-List<Shot>&
+List<Shot>&
Ship::GetThreatList()
{
return threat_list;
@@ -4681,7 +4681,7 @@ Ship::InflictSystemDamage(double damage, Shot* shot, Point impact)
}
}
}
- }
+ }
// if a system was in range of the blast, assess the damage:
if (system) {
@@ -4836,7 +4836,7 @@ Ship::ExecMaintFrame(double seconds)
const DWORD REPAIR_FREQUENCY = 5000; // once every five seconds
static DWORD last_repair_frame = 0; // one ship per game frame
- if (auto_repair &&
+ if (auto_repair &&
Game::GameTime() - last_repair_time > REPAIR_FREQUENCY &&
last_repair_frame != Game::Frame()) {
@@ -4859,7 +4859,7 @@ Ship::ExecMaintFrame(double seconds)
PowerSource* pwr = reactors[i];
if (pwr != src && pwr->Availability() > src->Availability()) {
- if (!dst ||
+ if (!dst ||
(pwr->Availability() > dst->Availability() &&
pwr->Charge() > dst->Charge()))
dst = pwr;
@@ -4882,7 +4882,7 @@ Ship::ExecMaintFrame(double seconds)
if (c->Status() < Component::NOMINAL && c->Availability() < 75) {
if (c->SpareCount() &&
c->ReplaceTime() <= 300 &&
- (c->Availability() < 50 ||
+ (c->Availability() < 50 ||
c->ReplaceTime() < c->RepairTime())) {
c->Replace();
@@ -4915,7 +4915,7 @@ Ship::ExecMaintFrame(double seconds)
iter.removeItem();
// emergency power routing (restore):
- if (sys->Type() == System::POWER_SOURCE &&
+ if (sys->Type() == System::POWER_SOURCE &&
sys->Status() == System::NOMINAL) {
PowerSource* src = (PowerSource*) sys;
int isrc = reactors.index(src);
@@ -5028,7 +5028,7 @@ Ship::SetControls(MotionController* m)
dir = nav;
return;
}
-
+
else if (!nav->Complete()) {
return;
}
@@ -5098,7 +5098,7 @@ Ship::IFFColor(int iff)
break;
}
- return c;
+ return c;
}
Color