Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 13, 2016, 11:13:30 PM (8 years ago)
Author:
landauf
Message:

added c++11 features to code that was modified in presentationHS15

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3/src/orxonox/weaponsystem/Munition.cc

    r11054 r11062  
    5252        this->reloadTime_ = 0.5f;
    5353
    54         this->lastFilledWeaponMode_ = NULL;
     54        this->lastFilledWeaponMode_ = nullptr;
    5555    }
    5656
     
    200200                    magazine->munition_ = 0;
    201201
    202                     if (this->reload(NULL))
     202                    if (this->reload(nullptr))
    203203                        // Successfully reloaded, continue recursively
    204204                        return this->takeMunition(amount, 0);
     
    271271            if (it->first == lastFilledWeaponMode_)
    272272            {
    273                 lastFilledWeaponMode_ = NULL;
     273                lastFilledWeaponMode_ = nullptr;
    274274            }           
    275275            delete it->second;
     
    315315        {
    316316            // Stacking munition means, if a magazine gets full, the munition adds to a new magazine
    317             Magazine* magazine = this->getMagazine(NULL);
     317            Magazine* magazine = this->getMagazine(nullptr);
    318318            if (magazine)
    319319            {
     
    347347            // If the pointer to the weapon mode whose magazine got munition added to is NULL, then set the iterator to the beginning of the map
    348348            // Otherwise set it to the next weapon mode
    349             if (lastFilledWeaponMode_ == NULL)
     349            if (lastFilledWeaponMode_ == nullptr)
    350350            {
    351351                it = this->assignedMagazines_.begin();
     
    441441        for (unsigned int i = 0; i < addedMagazines; ++i)
    442442        {
    443             for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
    444             {
    445                 if (needReload(it->first))
    446                 {
    447                     reload(it->first);
     443            for (const auto& mapEntry : this->assignedMagazines_)
     444            {
     445                if (needReload(mapEntry.first))
     446                {
     447                    reload(mapEntry.first);
    448448                    break;
    449449                }
     
    523523            if (it->first == lastFilledWeaponMode_)
    524524            {
    525                 lastFilledWeaponMode_ = NULL;
     525                lastFilledWeaponMode_ = nullptr;
    526526            }
    527527            delete it->second;
Note: See TracChangeset for help on using the changeset viewer.