From 6e6a864c17403a99ee866c2330061d6e31506bbe Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 11 Nov 2007 18:12:55 +0000 Subject: Don't draw objects with negative x/y values. Now, "ghost" objects are no longer created in the top left corner of the screen when picked up/used. The creation of such ghost objects is a script bug which exists in the original interpreter of IHNM as well. Also, removed a relevant workaround for the note in the first screen of Gorrister's chapter, as it's no longer needed svn-id: r29477 --- engines/saga/actor.cpp | 7 +++++++ engines/saga/script.cpp | 13 ------------- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'engines/saga') diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 774d348446..2dfdedcc37 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -989,6 +989,13 @@ void Actor::createDrawOrderList() { if (obj->_sceneNumber != _vm->_scene->currentSceneNumber()) continue; + // WORKAROUND for a bug found in the original interpreter of IHNM + // If an object's x or y value is negative, don't draw it + // Scripts set negative values for an object's x and y when it shouldn't + // be drawn anymore (i.e. when it's picked up or used) + if (obj->_location.x < 0 || obj->_location.y < 0) + continue; + if (calcScreenPosition(obj)) { _drawOrderList.pushBack(obj, compareFunction); } diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 642e9dab9b..51e40defd1 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -805,19 +805,6 @@ void Script::whichObject(const Point& mousePoint) { objectId = ID_NOTHING; newObjectId = ID_NOTHING; } - - // WORKAROUND for a script bug in the original game scripts of IHNM - // When the note (item 16406) in the first screen of Gorrister's chapter - // is read, an invisible ghost object is created in the upper left corner - // of the screen, that the player can interact with. We ignore that invalid - // object here - if (_vm->getGameType() == GType_IHNM) { - if (objectId == 16406 && mousePoint.x < 60 && mousePoint.y < 60) { - objectId = ID_NOTHING; - newObjectId = ID_NOTHING; - newRightButtonVerb = getVerbType(kVerbNone); - } - } } else { actor = _vm->_actor->getActor(newObjectId); objectId = newObjectId; -- cgit v1.2.3