diff options
author | Stijn Buys <ingar@osirion.org> | 2009-08-18 09:24:15 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-08-18 09:24:15 +0000 |
commit | f030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch) | |
tree | cd92baf9e4fa8a136523b9eb570e9811846c9250 /src/game/base/collision.cc | |
parent | 5636fad174f0bcff857c357c394c4cc8d424b302 (diff) |
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/game/base/collision.cc')
-rw-r--r-- | src/game/base/collision.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game/base/collision.cc b/src/game/base/collision.cc index 4e6f4bb..952bba2 100644 --- a/src/game/base/collision.cc +++ b/src/game/base/collision.cc @@ -18,18 +18,18 @@ void Collision::distance_test(core::EntityControlable *first, core::Entity *seco { if (!first->owner()) return; - + if (first->state() == core::Entity::Docked) return; - + // FIXME - use distancesquared const float d = math::distance(first->location(), second->location()); const float r = first->radius() + second->radius(); - + if (second->type() == core::Entity::Globe) { // collision with a star or a planet - - if ((d-r) < 0.0f) { + + if ((d - r) < 0.0f) { // crash zone if ((first->moduletype() == ship_enttype) && (first->state() != core::Entity::Destroyed)) { first->owner()->send_warning("^RBOOM!^N"); @@ -38,9 +38,9 @@ void Collision::distance_test(core::EntityControlable *first, core::Entity *seco } } else if (first->owner()->last_warning() + 5.0f < core::application()->time()) { // warning zone: star corona or planet atmosphere - if ((second->moduletype() == star_enttype) && (d-r < 50.0f)) { + if ((second->moduletype() == star_enttype) && (d - r < 50.0f)) { first->owner()->send_warning("^3Warning: entering star corona!^N"); - } else if ((second->moduletype() == planet_enttype) && (d-r < Planet::safe_distance)) { + } else if ((second->moduletype() == planet_enttype) && (d - r < Planet::safe_distance)) { first->owner()->send_warning("^3Warning: entering planet gravity well!^N"); } } @@ -51,7 +51,7 @@ void Collision::frame_zone(core::Zone *zone) { core::Zone::Content::iterator first; core::Zone::Content::iterator second; - + for (first = zone->content().begin(); first != zone->content().end(); first ++) { second = first; for (second++; second != zone->content().end(); second++) { |