From 960ad3623f8ff735f77791026f3d4a38b8b1dd3e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 26 Aug 2017 12:40:08 -0400 Subject: TITANIC: Fix error setting correct PET buttons for a given area --- engines/titanic/pet_control/pet_frame.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control') diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp index 9088cfe126..738116ed8f 100644 --- a/engines/titanic/pet_control/pet_frame.cpp +++ b/engines/titanic/pet_control/pet_frame.cpp @@ -143,8 +143,11 @@ bool CPetFrame::setPetControl(CPetControl *petControl) { void CPetFrame::setArea(PetArea newArea) { resetArea(); - if ((uint)newArea < _petAreas.size()) - _modeButtons[_petAreas[newArea]].setMode(MODE_SELECTED); + + for (uint idx = 0; idx < _modeButtons.size(); ++idx) { + if (_petAreas[idx] == newArea) + _modeButtons[idx].setMode(MODE_SELECTED); + } } void CPetFrame::resetArea() { -- cgit v1.2.3