Changeset 5661 for code/branches/resource2/src/core/LuaState.cc
- Timestamp:
- Aug 19, 2009, 12:19:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/core/LuaState.cc
r5660 r5661 147 147 sourceFileInfo_ = sourceFileInfo; 148 148 149 //if (!bIsRunning_)150 //{151 // bIsRunning_ = true;152 153 149 int error = 0; 154 150 #if LUA_VERSION_NUM != 501 … … 163 159 // execute the chunk 164 160 if (error == 0) 165 error = lua_pcall(luaState_, 0, 0, 0);161 error = lua_pcall(luaState_, 0, 1, 0); 166 162 if (error != 0) 167 163 { … … 170 166 origin = " originating from " + sourceFileInfo_->filename; 171 167 COUT(2) << "Error in Lua-script" << origin << ": " << lua_tostring(luaState_, -1) << std::endl; 172 } 173 174 // bIsRunning_ = false; 175 //} 176 //else 177 //{ 178 // COUT(2) << "Warning: LuaState do function called while running!" << std::endl; 179 //} 168 // return value is nil 169 lua_pushnil(luaState_); 170 } 171 // push return value because it will get lost since the return value of this function is void 172 lua_setglobal(luaState_, "LuaStateReturnValue"); 180 173 181 174 // Load the old info again … … 191 184 { 192 185 OutputHandler::getOutStream().setOutputLevel(level) << message << std::endl; 186 } 187 188 bool LuaState::fileExists(const std::string& filename, const std::string& resourceGroup, bool bSearchOtherPaths) 189 { 190 shared_ptr<ResourceInfo> info = this->getFileInfo(filename, resourceGroup, bSearchOtherPaths); 191 if (info == NULL) 192 return false; 193 else 194 return true; 193 195 } 194 196
Note: See TracChangeset
for help on using the changeset viewer.