aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/processroom.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-12-24 17:51:04 +0100
committerWillem Jan Palenstijn2015-12-24 20:28:57 +0100
commit1a1525a15501072da93ec0a7c1ef356886bd13a8 (patch)
tree10dcfc98f83b25aea7f202ecb901c7f81aca886a /engines/lab/processroom.cpp
parentcd3ebf687c0e783147723095056d72684eddd347 (diff)
downloadscummvm-rg350-1a1525a15501072da93ec0a7c1ef356886bd13a8.tar.gz
scummvm-rg350-1a1525a15501072da93ec0a7c1ef356886bd13a8.tar.bz2
scummvm-rg350-1a1525a15501072da93ec0a7c1ef356886bd13a8.zip
LAB: Avoid manual memory management of ViewData
Diffstat (limited to 'engines/lab/processroom.cpp')
-rw-r--r--engines/lab/processroom.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index e49d2acd02..daf4f3ba84 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -56,16 +56,16 @@ ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) {
if (_rooms[roomNum]._roomMsg.empty())
_resource->readViews(roomNum);
- ViewData *view = _rooms[roomNum]._view[direction];
+ Common::List<ViewData> &views = _rooms[roomNum]._view[direction];
- do {
- if (checkConditions(view->_condition))
- break;
+ Common::List<ViewData>::iterator view;
- view = view->_nextCondition;
- } while (true);
+ for (view = views.begin(); view != views.end(); ++view) {
+ if (checkConditions(view->_condition))
+ return &(*view);
+ }
- return view;
+ error("No view with matching condition found");
}
CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) {