aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-03 14:55:25 +0200
committerEugene Sandulenko2019-09-03 17:17:09 +0200
commit106a63aa81a17d9598936785b55d80641d6432de (patch)
treeacd8e16b8720fff99ce8193b7e7d5464581dd03f /engines
parent734995512e354af0dac3ee5681372f283c7d375e (diff)
downloadscummvm-rg350-106a63aa81a17d9598936785b55d80641d6432de.tar.gz
scummvm-rg350-106a63aa81a17d9598936785b55d80641d6432de.tar.bz2
scummvm-rg350-106a63aa81a17d9598936785b55d80641d6432de.zip
HDB: Add LASTMAPNAME Lua variable
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/hdb.cpp2
-rw-r--r--engines/hdb/hdb.h4
-rw-r--r--engines/hdb/lua-script.cpp7
3 files changed, 9 insertions, 4 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 978e85ca31..d4db1cf536 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -76,6 +76,8 @@ bool HDBGame::init() {
Game Subsystem Initializations
*/
+ _lastMapname[0] = 0;
+
// Init fileMan
if (!_fileMan->openMPC(getGameFile())) {
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index c93cdf4542..62c266e442 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -189,6 +189,8 @@ public:
return _timeSlice - _prevTimeSlice;
}
+ char *lastMapname() { return _lastMapname; }
+
bool _gameShutdown;
Graphics::PixelFormat _format;
@@ -207,6 +209,8 @@ private:
int _actionMode; // 0 or 1
int _pauseFlag;
+ char _lastMapname[64];
+
};
extern HDBGame *g_hdb;
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index a42ca79857..8e7083b653 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -1346,10 +1346,9 @@ bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *scrip
lua_setglobal(_state, luaGlobalValues[j].luaName);
}
- /*
- TODO: Set the last mapName as a global
- after implementing the map-manager.
- */
+ // set the last mapname as a global
+ lua_pushstring(_state, g_hdb->lastMapname());
+ lua_setglobal(_state, "LASTMAP");
// Set the lowest printable line
lua_pushnumber(_state, 480 - 14);