Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 5:25:38 PM (15 years ago)
Author:
dsommer
Message:

funktioniert :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc

    r2342 r2389  
    99        bool ShipEquipment::insert(Item* item)
    1010        {
    11         if(checkSlot(item)==true)
     11        if(checkSlot(item)==NULL)
    1212        {
    1313                Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );
    1414                return true;
    1515        }
    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                }
    1725                return false;
     26        }
    1827
    1928        return false;
     
    4857        }
    4958
    50         bool ShipEquipment::checkSlot(Item* item)
     59        Item* ShipEquipment::checkSlot(Item* item)
    5160        {
    5261        std::multimap<std::string,Item*>::iterator it;
     
    5564                //if((*it).second->getPlayerBaseClass()==item->getPlayerBaseClass())
    5665                if(item->isExactlyA((*it).second->getIdentifier()))
    57                 return false;
     66                return (*it).second;
    5867        }
    59         return true;
     68        return NULL;
    6069        };
     70       
    6171}
Note: See TracChangeset for help on using the changeset viewer.