Changeset 9292 for code/branches/presentation2012merge
- Timestamp:
- Jun 11, 2012, 10:40:01 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/PickupCollection.cc
r9290 r9292 273 273 const Pickupable* PickupCollection::getPickupable(unsigned int index) const 274 274 { 275 unsigned int count = 0; 276 for (std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it) 277 { 278 if (count == index) 279 return *it; 280 else 281 ++count; 282 } 283 return NULL; 275 if(this->pickups_.size() >= index) 276 return NULL; 277 278 std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); 279 std::advance(it, index); 280 return *it; 284 281 } 285 282
Note: See TracChangeset
for help on using the changeset viewer.