Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 7, 2011, 12:08:27 AM (14 years ago)
Author:
dafrick
Message:

Adding warning for levels with same names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/LevelManager.cc

    r7999 r8039  
    251251        // Iterate over all the found *.oxw files
    252252        COUT(3) << "Loading LevelInfos..." << std::endl;
     253        std::set<std::string> names;
    253254        for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it)
    254255        {
     
    277278                }
    278279
     280                // Warn about levels with the same name.
     281                if(!names.insert(info->getName()).second)
     282                    COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with name '" << info->getName() << "' found!" << std::endl;
     283
    279284                // Warn about multiple items so that it gets fixed quickly
    280285                if(availableLevels_.find(info) != availableLevels_.end())
    281286                {
    282                     COUT(2) << "Warning: Multiple levels with name '" << info->getName() << "' found!" << std::endl;
     287                    COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with same name '" << info->getName() << "' and filename found! Exluding..." << std::endl;
    283288                    // Delete LevelInfoItem to avoid a dangling pointer
    284289                    delete info;
Note: See TracChangeset for help on using the changeset viewer.