Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10293 in orxonox.OLD


Ignore:
Timestamp:
Jan 18, 2007, 3:57:34 PM (17 years ago)
Author:
snellen
Message:

fixed compatibility issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/heathaze/src/lib/script_engine/script.cc

    r10292 r10293  
    9393bool Script::loadFile(const std::string& filename)
    9494 {
    95 
    96    int seperation =  filename.find_first_of('/');
    97    std::string directory = filename.substr( seperation, 0 );
    98    std::string file = filename.substr( seperation );
    99 
    100    printf("Directory is %s \n", directory.c_str());
    101    printf("File is %s \n", file.c_str());
     95   
     96   std::string directory = "";
     97   std::string file = filename;
     98   
     99   unsigned int seperation =  filename.find_first_of('/');
     100   if (seperation != std::string::npos)
     101   {
     102    directory = filename.substr( 0, seperation+1 );
     103    file = filename.substr( seperation+1 );
     104   }
    102105
    103106   std::string filedest(Resources::ResourceManager::getInstance()->mainGlobalPath().name());
    104    filedest += "/scripts/" + directory + filename;
     107   filedest += "scripts/" + directory + file;
    105108
    106109   this->addThisScript();
     
    137140   }
    138141
     142   printf("SCRIPT : ERROR: while loading file %s \n",filename.c_str());
    139143   return false;
    140144 }
Note: See TracChangeset for help on using the changeset viewer.