Ignore:
Timestamp:
2010-05-28 07:39:52 (2 years ago)
Author:
kpoole
Message:

Episode 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/game_config.cpp

    r12 r26  
    277277    const color_range& color_info(const std::string& name) 
    278278    { 
    279         std::map<std::string, color_range>::const_iterator i = team_rgb_range.find(name); 
     279        // KP: get rid of trailing \n 
     280        std::string checkName = name; 
     281        int pos = checkName.find('\n'); 
     282        if (pos != std::string::npos) 
     283        { 
     284            checkName = checkName.substr(0, pos); 
     285        } 
     286        std::map<std::string, color_range>::const_iterator i = team_rgb_range.find(checkName); 
    280287        if(i == team_rgb_range.end()) { 
    281288            try { 
    282                 team_rgb_range.insert(std::make_pair(name,color_range(string2rgb(name)))); 
    283                 return color_info(name); 
     289                team_rgb_range.insert(std::make_pair(name,color_range(string2rgb(checkName)))); 
     290                return color_info(checkName); 
    284291            } catch(bad_lexical_cast&) { 
    285292                //ERR_NG << "Invalid color range: " << name; 
Note: See TracChangeset for help on using the changeset viewer.