diff options
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index 606a957e72..3c3efe1419 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -620,10 +620,13 @@ bool CPetControl::dismissBot(const CString &name) { CDismissBotMsg dismissMsg; for (CTreeItem *treeItem = view->getFirstChild(); treeItem; treeItem = treeItem->scan(view)) { - if (!treeItem->getName().compareToIgnoreCase(name)) - dismissMsg.execute(treeItem); - else - result = true; + CGameObject *obj = dynamic_cast<CGameObject *>(treeItem); + if (obj) { + if (!obj->getName().compareToIgnoreCase(name)) + result = true; + else + dismissMsg.execute(treeItem); + } } return result; |