From 3a8e1622af58c997b8d2b716e6d326a16db9e38a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 14 Aug 2010 19:56:45 +0000 Subject: SWORD25: Fix conversion bugs in BS_LuaBindhelper::_CreateTable() svn-id: r53237 --- engines/sword25/script/luabindhelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sword25') diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp index a4f42331e6..cca642de63 100644 --- a/engines/sword25/script/luabindhelper.cpp +++ b/engines/sword25/script/luabindhelper.cpp @@ -325,7 +325,7 @@ bool BS_LuaBindhelper::GetMetatable(lua_State *L, const Common::String &TableNam 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 @@ bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableNam // 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 @@ bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableNam 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); -- cgit v1.2.3