aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-05 16:51:43 +0200
committerEugene Sandulenko2019-09-03 17:17:12 +0200
commita29e3b96980150c8195b6f727df1758644695632 (patch)
tree86b016e1d9d49b14bed38ec0e0c246cdfe454ed6
parent73be5db12ecb4d83afa8c4a4248a9f857a470de3 (diff)
downloadscummvm-rg350-a29e3b96980150c8195b6f727df1758644695632.tar.gz
scummvm-rg350-a29e3b96980150c8195b6f727df1758644695632.tar.bz2
scummvm-rg350-a29e3b96980150c8195b6f727df1758644695632.zip
HDB: Proper place for the cheat patches. And wrap them into a define
We need to apply them after the map has been loaded, not before
-rw-r--r--engines/hdb/hdb.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 054ae22c09..92d2939ff0 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -34,6 +34,8 @@
#include "hdb/console.h"
#include "hdb/menu.h"
+#define CHEAT_PATCHES 1
+
namespace HDB {
HDBGame* g_hdb;
@@ -163,13 +165,6 @@ bool HDBGame::restartMap() {
_lua->init();
_lua->loadLua(_currentLuaName);
- // Cheat/workarounds
- if (!strcmp(_currentLuaName, "MAP00.LUA")) {
- Common::String patch("KillTrigger( \"mannyquest\" )");
-
- _lua->executeChunk(patch, "MAP00 patch");
- }
-
_sound->markSoundCacheFreeable();
_map->restartSystem();
@@ -178,6 +173,15 @@ bool HDBGame::restartMap() {
_ai->initAnimInfo();
+ // Cheat/workarounds
+#if CHEAT_PATCHES
+ if (!strcmp(_currentLuaName, "MAP00.LUA")) {
+ Common::String patch("KillTrigger( \"mannyquest\" )");
+
+ _lua->executeChunk(patch, "MAP00 patch");
+ }
+#endif
+
// if there are Secret Stars here, stick the variable in Lua
if (!_menu->_starWarp && getStarsMonkeystone7() == STARS_MONKEYSTONE_7)
_lua->setLuaGlobalValue("secretstars", 1);