Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10292 in orxonox.OLD


Ignore:
Timestamp:
Jan 18, 2007, 3:14:52 PM (18 years ago)
Author:
snellen
Message:

patch that allows to organize the scripts in folders

File:
1 edited

Legend:

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

    r9916 r10292  
    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());
     102
    95103   std::string filedest(Resources::ResourceManager::getInstance()->mainGlobalPath().name());
    96    filedest += "/scripts/" + filename;
     104   filedest += "/scripts/" + directory + filename;
    97105
    98106   this->addThisScript();
     
    109117   if(error == 0)
    110118   {
    111      currentFile = filename;
     119     currentFile = file;
    112120     error = lua_pcall(luaState, 0, 0, 0);
    113121
Note: See TracChangeset for help on using the changeset viewer.