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 | |
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')
-rw-r--r-- | engines/hdb/lua-script.cpp | 8 | ||||
-rw-r--r-- | engines/hdb/lua-script.h | 2 |
2 files changed, 5 insertions, 5 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); diff --git a/engines/hdb/lua-script.h b/engines/hdb/lua-script.h index 6949debc44..92574d268e 100644 --- a/engines/hdb/lua-script.h +++ b/engines/hdb/lua-script.h @@ -71,7 +71,7 @@ private: bool _systemInit; bool registerExtensions(); - bool executeChunk(Common::String &chunk, uint chunkSize, const Common::String &chunkName) const; + bool executeChunk(Common::String &chunk, const Common::String &chunkName) const; void stripComments(char *chunk); void addPatches(Common::String &chunk, const char *scriptName); }; |