aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-26 12:40:08 -0400
committerPaul Gilbert2017-08-26 12:40:08 -0400
commit960ad3623f8ff735f77791026f3d4a38b8b1dd3e (patch)
tree83afaf3317f2d3ccf45903e36c21fb6ed693255e /engines/titanic/pet_control
parent6291eb75d0690c1e3c88434b6e1720f051341969 (diff)
downloadscummvm-rg350-960ad3623f8ff735f77791026f3d4a38b8b1dd3e.tar.gz
scummvm-rg350-960ad3623f8ff735f77791026f3d4a38b8b1dd3e.tar.bz2
scummvm-rg350-960ad3623f8ff735f77791026f3d4a38b8b1dd3e.zip
TITANIC: Fix error setting correct PET buttons for a given area
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_frame.cpp7
1 files changed, 5 insertions, 2 deletions
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() {