[Scummvm-cvs-logs] SF.net SVN: scummvm:[53237] scummvm/trunk/engines/sword25/script/ luabindhelper.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 00:43:55 CEST 2010


Revision: 53237
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53237&view=rev
Author:   sev
Date:     2010-10-12 22:43:55 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Fix conversion bugs in BS_LuaBindhelper::_CreateTable()

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/script/luabindhelper.cpp

Modified: scummvm/trunk/engines/sword25/script/luabindhelper.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/luabindhelper.cpp	2010-10-12 22:43:36 UTC (rev 53236)
+++ scummvm/trunk/engines/sword25/script/luabindhelper.cpp	2010-10-12 22:43:55 UTC (rev 53237)
@@ -325,7 +325,7 @@
 bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableName) {
 	const char *PartBegin = TableName.c_str();
 
-	while (PartBegin) {
+	while (*PartBegin) {
 		const char *PartEnd = strchr(PartBegin, '.');
 		if (!PartEnd)
 			PartEnd = PartBegin + strlen(PartBegin);
@@ -338,7 +338,7 @@
 		// Verify that the table with the name already exists
 		// The first round will be searched in the global namespace, with later passages
 		// in the corresponding parent table in the stack
-		if (PartBegin == 0) {
+		if (PartBegin == TableName.c_str()) {
 			lua_pushstring(L, SubTableName.c_str());
 			lua_gettable(L, LUA_GLOBALSINDEX);
 		} else {
@@ -357,7 +357,7 @@
 			lua_newtable(L);
 			lua_pushstring(L, SubTableName.c_str());
 			lua_pushvalue(L, -2);
-			if (PartBegin == 0)
+			if (PartBegin == TableName.c_str())
 				lua_settable(L, LUA_GLOBALSINDEX);
 			else {
 				lua_settable(L, -4);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list