Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2008, 5:13:34 PM (15 years ago)
Author:
polakma
Message:

fixed attaching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSystem.cc

    r2327 r2331  
    6363    {
    6464        wPack->setParentWeaponSystem(this);
    65         this->weaponSets_[firemode]->attachWeaponPack(wPack);
    66         this->weaponPacks_[firemode] = wPack;
     65        if (firemode < this->weaponSets_.size())
     66            this->weaponSets_[firemode]->attachWeaponPack(wPack);
     67        this->weaponPacks_.push_back(wPack);
    6768    }
    6869
     
    8586    Munition * WeaponSystem::getMunitionType(std::string munitionType)
    8687    {
    87         return this->munitionSet_[munitionType];
     88        std::map<std::string, Munition *>::const_iterator it = this->munitionSet_.find(munitionType);
     89        if (it != this->munitionSet_.end())
     90            return it->second;
     91        else
     92            return 0;
    8893    }
    8994
Note: See TracChangeset for help on using the changeset viewer.