[Orxonox-commit 1938] r6655 - code/branches/gamestate/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Mar 29 23:27:36 CEST 2010


Author: rgrieder
Date: 2010-03-29 23:27:36 +0200 (Mon, 29 Mar 2010)
New Revision: 6655

Modified:
   code/branches/gamestate/src/libraries/core/LuaState.cc
Log:
Fixed a bug in LuaState that caused Lua Debugger to malfunction when showing lines.

Modified: code/branches/gamestate/src/libraries/core/LuaState.cc
===================================================================
--- code/branches/gamestate/src/libraries/core/LuaState.cc	2010-03-29 21:04:31 UTC (rev 6654)
+++ code/branches/gamestate/src/libraries/core/LuaState.cc	2010-03-29 21:27:36 UTC (rev 6655)
@@ -113,7 +113,21 @@
         else
             luaInput = code;
 
+        if (sourceFileInfo != NULL)
+        {
+            // Also fill a map with the actual source code. This is just for the include* commands
+            // where the content of sourceFileInfo->filename doesn't match 'code'
+            this->sourceCodeMap_[sourceFileInfo->filename] = code;
+        }
+
         this->doString(luaInput, sourceFileInfo);
+
+        if (sourceFileInfo != NULL)
+        {
+            // Delete source code entry
+            if (sourceFileInfo != NULL)
+                this->sourceCodeMap_.erase(sourceFileInfo->filename);
+        }
     }
 
     void LuaState::doFile(const std::string& filename)
@@ -139,10 +153,6 @@
             // Provide lua_load with the filename for debug purposes
             // The '@' is a Lua convention to identify the chunk name as filename
             chunkname = '@' + sourceFileInfo->filename;
-            
-            // Also fill a map with the actual source code. This is just for the include* commands
-            // where the content of sourceFileInfo->filename doesn't match 'code'
-            this->sourceCodeMap_[sourceFileInfo->filename] = code;
         }
         else
         {
@@ -183,10 +193,6 @@
 
         // Load the old info again
         sourceFileInfo_ = oldSourceFileInfo;
-
-        // Delete source code entry
-        if (sourceFileInfo != NULL)
-            this->sourceCodeMap_.erase(sourceFileInfo->filename);
     }
 
     void LuaState::luaPrint(const std::string& str)




More information about the Orxonox-commit mailing list