Changeset 10239 in orxonox.OLD for branches/mount_points/src/world_entities/world_entity.cc
- Timestamp:
- Jan 16, 2007, 10:52:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/world_entities/world_entity.cc
r10228 r10239 12 12 13 13 ### 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 16 17 */ 17 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY … … 73 74 this->scaling = 1.0f; 74 75 this->oiFile = NULL; 76 // add 10 members to this array 77 this->mountPoints.reserve(10); 75 78 76 79 /* OSOLETE */ … … 298 301 299 302 // now fill the mount point 300 this->oiFile->initMountPoint(mp);303 mp->initMountPoint( this->oiFile->getMountPointDescription()); 301 304 } 302 305 … … 364 367 void WorldEntity::addMountPoint(int slot, MountPoint* mountPoint) 365 368 { 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()); 369 377 } 370 378
Note: See TracChangeset
for help on using the changeset viewer.