summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Sim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Sim.cpp')
-rw-r--r--Stars45/Sim.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/Stars45/Sim.cpp b/Stars45/Sim.cpp
index 01fbe16..aa7f4b6 100644
--- a/Stars45/Sim.cpp
+++ b/Stars45/Sim.cpp
@@ -232,7 +232,7 @@ Sim::CommitMission()
Player* p = Player::GetCurrentPlayer();
p->ProcessStats(s, start_time);
- if (mission && mission->Type() == Mission::TRAINING &&
+ if (mission && mission->Type() == Mission::TRAINING &&
s->GetDeaths() == 0 && s->GetColls() == 0)
p->SetTrained(mission->Identity());
@@ -455,7 +455,7 @@ Sim::CreateRegions()
}
}
}
-
+
ListIter<OrbitalRegion> rgn = planet->Regions();
while (++rgn) {
SimRegion* sim_region = new(__FILE__,__LINE__) SimRegion(this, rgn.value());
@@ -465,7 +465,7 @@ Sim::CreateRegions()
}
}
}
-
+
ListIter<OrbitalRegion> rgn = star->Regions();
while (++rgn) {
SimRegion* sim_region = new(__FILE__,__LINE__) SimRegion(this, rgn.value());
@@ -587,7 +587,7 @@ Sim::CreateElements()
ActivateRegion(rgn);
}
- // if element belongs to a squadron,
+ // if element belongs to a squadron,
// find the carrier, squadron, flight deck, etc.:
if (msn_elem->Squadron().length() > 0) {
MissionElement* squadron_elem = mission->FindElement(msn_elem->Squadron());
@@ -792,8 +792,8 @@ Sim::CreateElements()
element->SetLoadout(loadout);
- Ship* ship = CreateShip(sname, rnum,
- (ShipDesign*) msn_elem->GetDesign(),
+ Ship* ship = CreateShip(sname, rnum,
+ (ShipDesign*) msn_elem->GetDesign(),
rgn_name, l2,
msn_elem->GetIFF(),
msn_elem->CommandAI(),
@@ -1434,7 +1434,7 @@ Sim::FindNearestRegion(SimObject* object, int type)
}
}
}
-
+
return result;
}
@@ -1459,7 +1459,7 @@ Sim::FindNearestSpaceRegion(Orbital* body)
}
}
}
-
+
return result;
}
@@ -1757,7 +1757,7 @@ Sim::ResolveHyperList()
}
jumplist.destroy();
-
+
if (pship && pship->GetRegion()) {
if (active_region != pship->GetRegion()) {
pship->GetRegion()->SetPlayerShip(pship);
@@ -2288,7 +2288,7 @@ SimRegion::SimRegion(Sim* s, OrbitalRegion* r)
Point init_loc((rand()-16384.0f) * 30,
(rand()-16384.0f) * 3,
(rand()-16384.0f) * 30);
- sim->CreateAsteroid(init_loc, i, Random(1e7, 1e8), this);
+ sim->CreateAsteroid(init_loc, i, Random(1e7, 1e8), this);
}
}
}
@@ -2436,7 +2436,7 @@ SimRegion::ClearSelection()
void
SimRegion::AddSelection(Ship* newsel)
{
- if (!newsel ||
+ if (!newsel ||
newsel->GetFlightPhase() < Ship::ACTIVE ||
newsel->GetFlightPhase() >= Ship::RECOVERY)
return;
@@ -2637,7 +2637,7 @@ SimRegion::UpdateShips(double seconds)
while (++ship_iter) {
ship = ship_iter.value();
-
+
if (ship_index == ai_index || ship == player_ship)
ship->SetAIMode(2);
else
@@ -2668,7 +2668,7 @@ SimRegion::UpdateShots(double seconds)
sim->CreateSplashDamage(shot);
}
}
-
+
if (shot->Life() < 0.01) { // died of old age
NetUtil::SendWepDestroy(shot);
@@ -2757,12 +2757,12 @@ SimRegion::DamageShips()
if (ship_destroyed) {
NetUtil::SendObjKill(ship, owner, shot->IsMissile() ? NetObjKill::KILL_SECONDARY : NetObjKill::KILL_PRIMARY);
Director* director;
-
+
Print(" %s Killed %s (%s)\n", owner_name, ship->Name(), FormatGameTime());
if (owner)
director = owner->GetDirector();
-
+
// alert the killer
if (director && director->Type() > SteerAI::SEEKER && director->Type() < SteerAI::GROUND) {
ShipAI* shipAI = (ShipAI*) director;
@@ -2883,7 +2883,7 @@ SimRegion::DamageShips()
if (shot->IsDrone())
drones.remove((Drone*) shot);
-
+
shot_iter.removeItem();
delete shot;
shot = 0;
@@ -2916,7 +2916,7 @@ SimRegion::DamageShips()
NetUtil::SendWepDestroy(shot);
if (shot->IsDrone())
drones.remove((Drone*) shot);
-
+
shot_iter.removeItem();
delete shot;
shot = 0;
@@ -2934,7 +2934,7 @@ SimRegion::DamageShips()
if (!shot->IsBeam()) {
if (shot->IsDrone())
drones.remove((Drone*) shot);
-
+
shot_iter.removeItem();
delete shot;
shot = 0;
@@ -2959,8 +2959,8 @@ SimRegion::CollideShips()
ListIter<Ship> ship_iter = ships;
while (++ship_iter) {
Ship* ship = ship_iter.value();
-
- if (ship->InTransition() ||
+
+ if (ship->InTransition() ||
ship->GetFlightPhase() < Ship::ACTIVE ||
ship->MissionClock() < 10000 ||
ship->IsNetObserver())
@@ -2975,7 +2975,7 @@ SimRegion::CollideShips()
if (targ == ship) continue;
- if (targ->InTransition() ||
+ if (targ->InTransition() ||
targ->GetFlightPhase() < Ship::ACTIVE ||
targ->MissionClock() < 10000 ||
targ->IsNetObserver())
@@ -3143,8 +3143,8 @@ SimRegion::CrashShips()
while (++ship_iter) {
Ship* ship = ship_iter.value();
- if (!ship->IsGroundUnit() &&
- !ship->InTransition() &&
+ if (!ship->IsGroundUnit() &&
+ !ship->InTransition() &&
ship->Class() != Ship::LCA &&
ship->AltitudeAGL() < ship->Radius()/2) {
if (ship->GetFlightPhase() == Ship::ACTIVE || ship->GetFlightPhase() == Ship::APPROACH) {
@@ -3255,7 +3255,7 @@ SimRegion::DestroyShip(Ship* ship)
if (sim->netgame && respawn)
sim->netgame->Respawn(ship->GetObjID(), spawn);
- int n = strlen(ship_name);
+ int n = strlen(ship_name);
if (n > 2) {
if (ship_name[n-2] == ' ' && isdigit(ship_name[n-1]))
ship_name[n-2] = 0;
@@ -3445,7 +3445,7 @@ SimRegion::InsertObject(Ship* ship)
TranslateObject(ship);
ship->SetRegion(this);
-
+
if (active)
ship->Activate(sim->scene);
}
@@ -3468,7 +3468,7 @@ SimRegion::InsertObject(Shot* shot)
TranslateObject(shot);
shot->SetRegion(this);
-
+
if (active)
shot->Activate(sim->scene);
}
@@ -3488,7 +3488,7 @@ SimRegion::InsertObject(Explosion* exp)
explosions.append(exp);
TranslateObject(exp);
exp->SetRegion(this);
-
+
if (active)
exp->Activate(sim->scene);
}
@@ -3508,7 +3508,7 @@ SimRegion::InsertObject(Debris* d)
debris.append(d);
TranslateObject(d);
d->SetRegion(this);
-
+
if (active)
d->Activate(sim->scene);
}
@@ -3528,7 +3528,7 @@ SimRegion::InsertObject(Asteroid* a)
asteroids.append(a);
TranslateObject(a);
a->SetRegion(this);
-
+
if (active)
a->Activate(sim->scene);
}