Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/weaponsystem/Munition.cc

    r11052 r11054  
    5757    Munition::~Munition()
    5858    {
    59         for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
    60             delete it->second;
     59        for (const auto& mapEntry : this->assignedMagazines_)
     60            delete mapEntry.second;
    6161    }
    6262
     
    7676            // For separated magazines we definitively need a given user
    7777            if (!user)
    78                 return 0;
     78                return nullptr;
    7979
    8080            // Use the map to get the magazine assigned to the given user
     
    9090        }
    9191
    92         return 0;
     92        return nullptr;
    9393    }
    9494
     
    262262        if (deployment_ != MunitionDeployment::Separate)
    263263        {
    264             user = NULL;
     264            user = nullptr;
    265265        }
    266266
     
    299299        {
    300300            // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
    301             for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
    302                 if (it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
     301            for (const auto& mapEntry : this->assignedMagazines_)
     302                if (mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
    303303                    return true;
    304304        }
     
    515515        // If we don't use separate magazines, set user to 0
    516516        if (deployment_ != MunitionDeployment::Separate)
    517             user = NULL;
     517            user = nullptr;
    518518
    519519        // Remove the current magazine for the given user
Note: See TracChangeset for help on using the changeset viewer.