Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2508 for code


Ignore:
Timestamp:
Dec 17, 2008, 8:43:19 PM (16 years ago)
Author:
rgrieder
Message:

Bugfix in LuaBind.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/LuaBind.cc

    r2087 r2508  
    8484    }
    8585
    86     char line[1024];
     86    char line[1024*32];
    8787    std::string levelString = "";
    8888
    8989    while (file.good() && !file.eof())
    9090    {
    91       file.getline(line, 1024);
     91      file.getline(line, 1024*32);
    9292      levelString += line;
    9393      levelString += "\n";
     
    9797    //std::string output;
    9898
    99     if (luaTags) luaSource_ = replaceLuaTags(levelString);
     99    if (luaTags)
     100      luaSource_ = replaceLuaTags(levelString);
     101    else
     102      luaSource_ = levelString;
    100103    COUT(5) << "ParsedSourceCode: " << luaSource_ << std::endl;
    101104  }
     
    123126      isRunning_ = true;
    124127      int error = 0;
    125       std::string init = "local scr = orxonox.LuaBind:getInstance()\nlocal debug = print\nprint = function(s)\nscr:luaPrint(s)\nend\ninclude = function(f)\nfile = assert(io.open(\"" + this->includePath_ + "\"..\"/\"..f))\ncontent = file:read(\"*a\")\nfile:close()\nsource = scr:replaceLuaTags(content)\nassert(loadstring(source))()\nend\n";
     128      std::string init =
     129         "local scr = orxonox.LuaBind:getInstance()\n \
     130          local debug = print\n \
     131          print = function(s)\n \
     132              scr:luaPrint(s)\n \
     133          end\n \
     134          include = function(f)\n \
     135              file = assert(io.open(\"" + this->includePath_ + "\"..\"/\"..f))\n \
     136              content = file:read(\"*a\")\n \
     137              file:close()\n \
     138              source = scr:replaceLuaTags(content)\n \
     139              assert(loadstring(source))()\n \
     140          end\n";
    126141      init += luaSource_;
    127142  #if LUA_VERSION_NUM == 501
Note: See TracChangeset for help on using the changeset viewer.