aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-03-29 15:09:15 +0200
committerAlyssa Milburn2011-03-29 15:09:15 +0200
commitbd526aac1dc64ead135b42b08e46566636ba5a90 (patch)
treed5bf3ff3b9f533a7e9d34c96ddd240896986b2d6 /engines/mohawk
parentad7b6f68173db0ecb6d5a7925770c423874ded8b (diff)
downloadscummvm-rg350-bd526aac1dc64ead135b42b08e46566636ba5a90.tar.gz
scummvm-rg350-bd526aac1dc64ead135b42b08e46566636ba5a90.tar.bz2
scummvm-rg350-bd526aac1dc64ead135b42b08e46566636ba5a90.zip
MOHAWK: Destroying an LBGroupItem destroys the whole group.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp10
-rw-r--r--engines/mohawk/livingbooks.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 9dd5c9c032..bd2891ef7a 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2909,6 +2909,16 @@ void LBGroupItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStre
}
}
+void LBGroupItem::destroySelf() {
+ LBItem::destroySelf();
+
+ for (uint i = 0; i < _groupEntries.size(); i++) {
+ LBItem *item = _vm->getItemById(_groupEntries[i].entryId);
+ if (item)
+ item->destroySelf();
+ }
+}
+
void LBGroupItem::setEnabled(bool enabled) {
if (_starting) {
_starting = false;
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 6c22187cf3..3cd9142793 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -424,6 +424,7 @@ public:
void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream);
+ void destroySelf();
void setEnabled(bool enabled);
void setGlobalEnabled(bool enabled);
bool contains(Common::Point point);