diff options
author | Eugene Sandulenko | 2019-07-05 13:18:40 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:12 +0200 |
commit | 03f1a137865dc99de5d433ce90ddf19b154b3547 (patch) | |
tree | 4536a5ed1bbe19b8f53c97083ab34a3d54d9d718 /engines/hdb/lua-script.cpp | |
parent | 1b924b23b9e699dcc56edf9560fec8d7780d1de3 (diff) | |
download | scummvm-rg350-03f1a137865dc99de5d433ce90ddf19b154b3547.tar.gz scummvm-rg350-03f1a137865dc99de5d433ce90ddf19b154b3547.tar.bz2 scummvm-rg350-03f1a137865dc99de5d433ce90ddf19b154b3547.zip |
HDB: Simplify executeChunk() function
Diffstat (limited to 'engines/hdb/lua-script.cpp')
-rw-r--r-- | engines/hdb/lua-script.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index e4d5f0efe7..7da2bd9bd8 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -1576,7 +1576,7 @@ bool LuaScript::executeMPC(Common::SeekableReadStream *stream, const char *name, addPatches(chunkString, scriptName); - if (!executeChunk(chunkString, chunkString.size(), name)) { + if (!executeChunk(chunkString, name)) { delete[] chunk; return false; @@ -1610,7 +1610,7 @@ bool LuaScript::executeFile(const Common::String &filename) { addPatches(fileDataString, filename.c_str()); - if (!executeChunk(fileDataString, fileDataString.size(), filename)) { + if (!executeChunk(fileDataString, filename)) { delete[] fileData; delete file; @@ -1623,14 +1623,14 @@ bool LuaScript::executeFile(const Common::String &filename) { return true; } -bool LuaScript::executeChunk(Common::String &chunk, uint chunkSize, const Common::String &chunkName) const { +bool LuaScript::executeChunk(Common::String &chunk, const Common::String &chunkName) const { if (!_systemInit) { return false; } // Compile Chunk - if (luaL_loadbuffer(_state, chunk.c_str(), chunkSize, chunkName.c_str())) { + if (luaL_loadbuffer(_state, chunk.c_str(), chunk.size(), chunkName.c_str())) { error("Couldn't compile \"%s\": %s", chunkName.c_str(), lua_tostring(_state, -1)); lua_pop(_state, -1); |