- Timestamp:
- Dec 10, 2008, 5:25:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc
r2342 r2389 9 9 bool ShipEquipment::insert(Item* item) 10 10 { 11 if(checkSlot(item)== true)11 if(checkSlot(item)==NULL) 12 12 { 13 13 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) ); 14 14 return true; 15 15 } 16 COUT(3) << "swap?" << std::endl; 16 else 17 { 18 COUT(3) << "SWAP?" << endl; 19 if((checkSlot(item)->dropped(player))==true); 20 { 21 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) ); 22 COUT(3) << "SWAPPED!" << endl; 23 return true; 24 } 17 25 return false; 26 } 18 27 19 28 return false; … … 48 57 } 49 58 50 boolShipEquipment::checkSlot(Item* item)59 Item* ShipEquipment::checkSlot(Item* item) 51 60 { 52 61 std::multimap<std::string,Item*>::iterator it; … … 55 64 //if((*it).second->getPlayerBaseClass()==item->getPlayerBaseClass()) 56 65 if(item->isExactlyA((*it).second->getIdentifier())) 57 return false;66 return (*it).second; 58 67 } 59 return true;68 return NULL; 60 69 }; 70 61 71 }
Note: See TracChangeset
for help on using the changeset viewer.