From 51cd9b488856dea791079ca6681c16c64d9d14d8 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 3 Nov 2017 09:19:21 +0200 Subject: DRASCULA: Remove superfluous variable --- engines/drascula/objects.cpp | 14 +++++--------- engines/drascula/saveload.cpp | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 4087eee11b..33d3674a45 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -97,7 +97,9 @@ void DrasculaEngine::gotoObject(int pointX, int pointY) { } void DrasculaEngine::checkObjects() { - int l, veo = 0; + int l; + + _hasName = false; for (l = 0; l < numRoomObjs; l++) { if (_mouseX > _objectX1[l] && _mouseY > _objectY1[l] @@ -105,21 +107,16 @@ void DrasculaEngine::checkObjects() { && visible[l] == 1 && isDoor[l] == 0) { strcpy(textName, objName[l]); _hasName = true; - veo = 1; } } if (_mouseX > curX + 2 && _mouseY > curY + 2 && _mouseX < curX + curWidth - 2 && _mouseY < curY + curHeight - 2) { - if (currentChapter == 2 || veo == 0) { + if (currentChapter == 2 || !_hasName) { strcpy(textName, "hacker"); _hasName = true; - veo = 1; } } - - if (veo == 0) - _hasName = false; } /** @@ -265,9 +262,8 @@ void DrasculaEngine::updateVisible() { } if (_roomNumber == 22 && flags[27] == 1) visible[3] = 0; - if (_roomNumber == 26 && flags[21] == 0) { + if (_roomNumber == 26 && flags[21] == 0) Common::strlcpy(objName[2], _textmisc[0], 20); - } if (_roomNumber == 26 && flags[18] == 1) visible[2] = 0; if (_roomNumber == 26 && flags[12] == 1) diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index 01c7ab7ee7..d54c3370e2 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -317,9 +317,8 @@ bool DrasculaEngine::loadGame(int slot) { takeObject = in->readSint32LE(); pickedObject = in->readSint32LE(); _loadedDifferentChapter = false; - if (!sscanf(currentData, "%d.ald", &roomNum)) { + if (!sscanf(currentData, "%d.ald", &roomNum)) error("Bad save format"); - } // When loading room 102 while being attached below the pendulum Some variables // are not correctly set and can cause random crashes when calling enterRoom below. -- cgit v1.2.3