Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7284 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
Apr 13, 2006, 8:52:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: sound plays again… hmm… this was a very stupid bug in MultiType… hope it is fixed now, but who knows…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/multi_type.cc

    r7221 r7284  
    296296  else if (this->type & MT_STRING)
    297297  {
    298     if (this->storedString == "") return 0;
    299     char* endPtr = NULL;
    300     int result = strtol(this->storedString.c_str(), &endPtr, 10);
    301     if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + strlen(this->storedString.c_str()))
    302       return 0;
    303     else
    304       return result;
     298    std::stringstream ssStream(this->storedString);
     299    int iReturn;
     300    ssStream >> iReturn;
     301    return iReturn;
    305302  }
    306303  return 0;
     
    323320    char* endPtr = NULL;
    324321    double result = strtod(this->storedString.c_str(), &endPtr);
    325     if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + strlen(this->storedString.c_str()))
     322    if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + this->storedString.size())
    326323      return 0.0f;
    327324    else
Note: See TracChangeset for help on using the changeset viewer.