diff options
author | D G Turner | 2018-10-09 18:10:40 +0100 |
---|---|---|
committer | D G Turner | 2018-10-09 18:10:40 +0100 |
commit | 110a1e3df5ea2b63544f3c95d1a7b48c0995e07d (patch) | |
tree | 06b765aec2f2c47f6659b5a3598eb914c862cab4 | |
parent | f39a9b5563588ad55d73a033ba29feabe53974c4 (diff) | |
download | scummvm-rg350-110a1e3df5ea2b63544f3c95d1a7b48c0995e07d.tar.gz scummvm-rg350-110a1e3df5ea2b63544f3c95d1a7b48c0995e07d.tar.bz2 scummvm-rg350-110a1e3df5ea2b63544f3c95d1a7b48c0995e07d.zip |
CGE2: Allow Triggering of Carpet Workaround from Debug Console.
This allows the recovery of saved games with the dead-end condition from
bug Trac #6842.
-rw-r--r-- | engines/cge2/console.cpp | 17 | ||||
-rw-r--r-- | engines/cge2/console.h | 5 |
2 files changed, 21 insertions, 1 deletions
diff --git a/engines/cge2/console.cpp b/engines/cge2/console.cpp index c67c7ab788..9bf22ebb89 100644 --- a/engines/cge2/console.cpp +++ b/engines/cge2/console.cpp @@ -22,12 +22,27 @@ #include "cge2/console.h" +#include "cge2/vga13h.h" + namespace CGE2 { -CGE2Console::CGE2Console(CGE2Engine *vm) : GUI::Debugger() { +CGE2Console::CGE2Console(CGE2Engine *vm) : _vm(vm), GUI::Debugger() { + registerCmd("do_carpet_workaround", WRAP_METHOD(CGE2Console, doCarpetWorkaround)); } CGE2Console::~CGE2Console() { } +bool CGE2Console::doCarpetWorkaround(int argc, const char **argv) { + Sprite *spr = _vm->_vga->_showQ->locate(1537); // 1537 is Carpet + + if (spr) { + if (spr->_actionCtrl[1]._ptr == 26) { + spr->_actionCtrl[1]._ptr = 8; + } + } + + return true; +} + } // End of namespace CGE diff --git a/engines/cge2/console.h b/engines/cge2/console.h index 15956bf728..8e8b6835ab 100644 --- a/engines/cge2/console.h +++ b/engines/cge2/console.h @@ -33,6 +33,11 @@ class CGE2Console : public GUI::Debugger { public: CGE2Console(CGE2Engine *vm); virtual ~CGE2Console(); + +private: + bool doCarpetWorkaround(int argc, const char **argv); + + CGE2Engine *_vm; }; } // End of namespace CGE |