aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-02 00:23:37 +0200
committerAlyssa Milburn2011-07-02 00:23:37 +0200
commit1d6df12446de5426b6992efcd388acf0a6d56cd1 (patch)
treeab5f0b52f8a37d8b81350cf9d12a738fb122d69a /engines/mohawk
parent35ef5ea28c7ea7db1abe5e78ba7993c21a1c493c (diff)
downloadscummvm-rg350-1d6df12446de5426b6992efcd388acf0a6d56cd1.tar.gz
scummvm-rg350-1d6df12446de5426b6992efcd388acf0a6d56cd1.tar.bz2
scummvm-rg350-1d6df12446de5426b6992efcd388acf0a6d56cd1.zip
MOHAWK: Always create a code object for every LBPage.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index d05c57104a..f9d18ff7ff 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -87,8 +87,14 @@ void LBPage::open(Archive *mhk, uint16 baseId) {
_baseId = baseId;
_vm->addArchive(_mhk);
- if (_vm->hasResource(ID_BCOD, baseId))
+ if (!_vm->hasResource(ID_BCOD, baseId)) {
+ // assume that BCOD is mandatory for v4/v5
+ if (_vm->getGameType() == GType_LIVINGBOOKSV4 || _vm->getGameType() == GType_LIVINGBOOKSV5)
+ error("missing BCOD resource (id %d)", baseId);
+ _code = new LBCode(_vm, 0);
+ } else {
_code = new LBCode(_vm, baseId);
+ }
loadBITL(baseId);
for (uint i = 0; i < _items.size(); i++)
@@ -2300,8 +2306,6 @@ void LBItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *
{
assert(size == 4);
uint offset = stream->readUint32();
- if (!_page->_code)
- error("no BCOD?");
_page->_code->runCode(this, offset);
}
break;
@@ -2823,8 +2827,6 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) {
break;
case kLBOpSendExpression:
- if (!_page->_code)
- error("no BCOD?");
_page->_code->runCode(this, entry->offset);
break;
@@ -2858,8 +2860,6 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) {
case kLBOpJumpUnlessExpression:
case kLBOpBreakExpression:
case kLBOpJumpToExpression:
- if (!_page->_code)
- error("no BCOD?");
{
LBValue r = _page->_code->runCode(this, entry->offset);
// FIXME