aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/objects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/objects.cpp')
-rw-r--r--engines/drascula/objects.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp
index 73aea7b7f2..2bd1014083 100644
--- a/engines/drascula/objects.cpp
+++ b/engines/drascula/objects.cpp
@@ -221,16 +221,17 @@ void DrasculaEngine::addObject(int obj) {
* If no inventory slot is under the mouse cursor, return 0.
*/
int DrasculaEngine::whichObject() {
- int n = 0;
+ int n;
for (n = 1; n < ARRAYSIZE(inventoryObjects); n++) {
if (mouseX > _itemLocations[n].x && mouseY > _itemLocations[n].y &&
mouseX < _itemLocations[n].x + OBJWIDTH &&
- mouseY < _itemLocations[n].y + OBJHEIGHT)
- break;
+ mouseY < _itemLocations[n].y + OBJHEIGHT) {
+ return n;
+ }
}
- return n;
+ return 0;
}
void DrasculaEngine::updateVisible() {