Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2454


Ignore:
Timestamp:
Dec 14, 2008, 11:02:58 PM (15 years ago)
Author:
rgrieder
Message:

Replaced bad collision type exceptions with asserts. The developer will know about the obvious error immediately and the end end user only sees a warning.

Location:
code/branches/physics_merge/src/orxonox/objects/worldentities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics_merge/src/orxonox/objects/worldentities/MobileEntity.cc

    r2452 r2454  
    158158        if (type == WorldEntity::Static)
    159159        {
    160             ThrowException(PhysicsViolation, "Cannot tell a MobileEntity to have static collision type");
     160            CCOUT(1) << "Error: Cannot tell a MobileEntity to have static collision type! Ignoring." << std::endl;
     161            assert(false); // Only in debug mode
    161162            return false;
    162163        }
  • code/branches/physics_merge/src/orxonox/objects/worldentities/StaticEntity.cc

    r2442 r2454  
    9999        if (type == WorldEntity::Kinematic || type == WorldEntity::Dynamic)
    100100        {
    101             ThrowException(PhysicsViolation, "Cannot tell a StaticEntity to have kinematic or dynamic collision type");
     101            CCOUT(1) << "Error: Cannot tell a StaticEntity to have kinematic or dynamic collision type! Ignoring." << std::endl;
     102            assert(false); // Only in debug mode
    102103            return false;
    103104        }
  • code/branches/physics_merge/src/orxonox/objects/worldentities/WorldEntity.cc

    r2452 r2454  
    463463        // Check for type legality. Could be StaticEntity or MobileEntity
    464464        if (!this->isCollisionTypeLegal(type))
    465             return; // exception gets issued anyway
     465            return;
    466466        if (type != None && !this->getScene()->hasPhysics())
    467467        {
  • code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2453 r2454  
    9595        if (type != WorldEntity::Dynamic)
    9696        {
    97             ThrowException(PhysicsViolation, "Cannot tell a SpaceShip not to be dynamic!");
     97            CCOUT(1) << "Error: Cannot tell a SpaceShip not to be dynamic! Ignoring." << std::endl;
     98            assert(false); // Only in debug mode
    9899            return false;
    99100        }
Note: See TracChangeset for help on using the changeset viewer.