From bd526aac1dc64ead135b42b08e46566636ba5a90 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 29 Mar 2011 15:09:15 +0200 Subject: MOHAWK: Destroying an LBGroupItem destroys the whole group. --- engines/mohawk/livingbooks.cpp | 10 ++++++++++ engines/mohawk/livingbooks.h | 1 + 2 files changed, 11 insertions(+) (limited to 'engines/mohawk') 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); -- cgit v1.2.3