From 6ad230da7c4d1bfc6e46c5f12e845ae43fe9439b Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 18 Jul 2017 12:33:33 -0500 Subject: SCI32: Fix kIsOnMe crashes in LSL7 About screen --- engines/sci/graphics/screen_item32.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics/screen_item32.cpp') diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index 7b7553189a..cac643edf9 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -131,8 +131,11 @@ void ScreenItem::operator=(const ScreenItem &other) { // to clear `_celObj` here; instead, it unconditionally set `_celInfo`, // didn't clear `_celObj`, and did hacky stuff in `kIsOnMe` to avoid // testing a mismatched `_celObj`. See `GfxFrameout::kernelIsOnMe` for - // more detail. - if (_celInfo != other._celInfo) { + // more detail. kCelTypeMem types are unconditionally invalidated because + // the properties of a CelObjMem can "change" when a game deletes a bitmap + // and then creates a new one that reuses the old bitmap's offset in + // BitmapTable (as happens in the LSL7 About screen when hovering names). + if (_celInfo.type == kCelTypeMem || _celInfo != other._celInfo) { _celInfo = other._celInfo; delete _celObj; _celObj = nullptr; -- cgit v1.2.3