Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 16, 2007, 10:52:55 PM (17 years ago)
Author:
patrick
Message:

found a bug in the object information resources file. fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/world_entities/world_entity.cc

    r10228 r10239  
    1212
    1313   ### File Specific:
    14    main-programmer: Patrick Boenzli, Benjamin Grauer
    15    co-programmer: Christian Meier
     14   main-programmer: Patrick Boenzli
     15   main-programmer: Benjamin Grauer
     16   co-programmer:   Christian Meier
    1617*/
    1718#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
     
    7374  this->scaling = 1.0f;
    7475  this->oiFile = NULL;
     76  // add 10 members to this array
     77  this->mountPoints.reserve(10);
    7578
    7679  /* OSOLETE */
     
    298301
    299302    // now fill the mount point
    300     this->oiFile->initMountPoint(mp);
     303    mp->initMountPoint( this->oiFile->getMountPointDescription());
    301304  }
    302305
     
    364367void WorldEntity::addMountPoint(int slot, MountPoint* mountPoint)
    365368{
    366   if( this->mountPoints[slot] != NULL)
    367   {
    368     PRINTF(0)("adding a mount point to a slot, that already is occupied! ignoring - maybe some object do not get connected well (object: %s)\n", this->getClassCName());
     369  if( this->mountPoints.capacity() < (unsigned int)slot)
     370  {
     371    // reserve 5 more slots than needed so this function is called as rare as possible
     372    this->mountPoints.reserve(slot + 5);
     373  }
     374  else if( this->mountPoints[slot] != NULL)
     375  {
     376    PRINTF(0)("adding a mount point to a slot, that already is occupied! ignoring - maybe some object did not get connected well (object: %s)\n", this->getClassCName());
    369377  }
    370378
Note: See TracChangeset for help on using the changeset viewer.