Changeset 5935 for code/branches/pickup/src/orxonox/pickup/DroppedItem.cc
- Timestamp:
- Oct 13, 2009, 5:05:17 PM (15 years ago)
- Location:
- code/branches/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup
- Property svn:mergeinfo changed
-
code/branches/pickup/src/orxonox/pickup/DroppedItem.cc
r5902 r5935 75 75 if (this->item_) 76 76 { 77 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++) //!< Iterate through all Pawns.77 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) //!< Iterate through all Pawns. 78 78 { 79 79 Vector3 distance = it->getWorldPosition() - this->getWorldPosition(); … … 93 93 { 94 94 COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl; 95 delete this;95 this->destroy(); 96 96 } 97 97 } … … 106 106 if (this->timeToLive_ > 0) 107 107 { 108 ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback)); 109 this->timer_.setTimer(this->timeToLive_, false, this, exec, false); 108 this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false); 110 109 } 111 110 } … … 123 122 { 124 123 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl; 125 delete this->item_;124 this->item_->destroy(); 126 125 } 127 126 128 delete this;127 this->destroy(); 129 128 } 130 129
Note: See TracChangeset
for help on using the changeset viewer.