Changeset 10540 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Jan 31, 2007, 5:04:11 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r10537 r10540 416 416 { 417 417 // add the mount point at the last position 418 this->mountPoints.push_back(mountPoint); 418 // this->mountPointMap[](mountPoint); 419 assert(false); 419 420 } 420 421 … … 425 426 void WorldEntity::addMountPoint(int slot, MountPoint* mountPoint) 426 427 { 427 if( this->mountPoints.capacity() < (unsigned int)slot) 428 { 429 // reserve 5 more slots than needed so this function is called as rare as possible 430 this->mountPoints.reserve(slot + 5); 431 } 432 else if( this->mountPoints[slot] != NULL) 433 { 434 PRINTF(4)("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()); 428 if( this->mountPointMap.find(slot) == this->mountPointMap.end()) 429 { 430 PRINTF(2)("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()); 435 431 } 436 432 437 433 // just connect the mount point 438 this->mountPoint s[slot] = mountPoint;434 this->mountPointMap[slot] = mountPoint; 439 435 } 440 436 … … 446 442 void WorldEntity::mount(int slot, WorldEntity* entity) 447 443 { 448 if( this->mountPoint s[slot] == NULL)444 if( this->mountPointMap.find(slot) == this->mountPointMap.end()) 449 445 { 450 446 PRINTF(0)("you tried to add an entity to a mount point that doesn't exist (slot %i)\n", slot);
Note: See TracChangeset
for help on using the changeset viewer.