aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-14 19:56:45 +0000
committerEugene Sandulenko2010-10-12 22:43:55 +0000
commit3a8e1622af58c997b8d2b716e6d326a16db9e38a (patch)
treefc027bacc1f350fe8a47eef0dddf291e8830eb43 /engines/sword25
parent72130c284d2f3b2db8d54da96f798806082029f3 (diff)
downloadscummvm-rg350-3a8e1622af58c997b8d2b716e6d326a16db9e38a.tar.gz
scummvm-rg350-3a8e1622af58c997b8d2b716e6d326a16db9e38a.tar.bz2
scummvm-rg350-3a8e1622af58c997b8d2b716e6d326a16db9e38a.zip
SWORD25: Fix conversion bugs in BS_LuaBindhelper::_CreateTable()
svn-id: r53237
Diffstat (limited to 'engines/sword25')
-rw-r--r--engines/sword25/script/luabindhelper.cpp6
1 files changed, 3 insertions, 3 deletions
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);