Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 17, 2009, 1:36:21 AM (15 years ago)
Author:
landauf
Message:

delete weaponpacks which were defined in xml but don't fit onto the weaponslots (in the future we could put them into the inventory).

+ some small changes

Location:
code/branches/particles2/src/orxonox/weaponsystem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/particles2/src/orxonox/weaponsystem/WeaponPack.cc

    r6076 r6078  
    9696            return;
    9797
    98         assert( std::find(this->weapons_.begin(), this->weapons_.end(), weapon)!=this->weapons_.end() );
    99         this->weapons_.erase( std::find(this->weapons_.begin(), this->weapons_.end(), weapon) );
     98        std::vector<Weapon*>::iterator it = std::find(this->weapons_.begin(), this->weapons_.end(), weapon);
     99        assert(it != this->weapons_.end());
     100        this->weapons_.erase(it);
    100101        weapon->setWeaponPack(0);
    101102    }
  • code/branches/particles2/src/orxonox/weaponsystem/WeaponSystem.cc

    r6076 r6078  
    221221
    222222        // Remove the WeaponPack from the WeaponSystem
    223         assert( std::find(this->weaponPacks_.begin(),this->weaponPacks_.end(),wPack)!=this->weaponPacks_.end() );
    224         this->weaponPacks_.erase( std::find(this->weaponPacks_.begin(),this->weaponPacks_.end(),wPack) );
     223        std::vector<WeaponPack*>::iterator it = std::find(this->weaponPacks_.begin(),this->weaponPacks_.end(), wPack);
     224        assert(it !=this->weaponPacks_.end());
     225        this->weaponPacks_.erase(it);
    225226    }
    226227
Note: See TracChangeset for help on using the changeset viewer.