diff options
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 5 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 110c3ff510..29646d1612 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -4931,6 +4931,9 @@ int Scene1337::getPreventionCardId(int cardId) { } bool Scene1337::isAttackPossible(int victimId, int cardId) { + if (victimId < 0 || victimId >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::isAttackPossible() victimId:%d out of range 0 to %d", victimId, ARRAYSIZE(_gameBoardSide)-1); + for (int i = 0; i <= 7; i++) { if (_gameBoardSide[victimId]._outpostStation[i]._cardId != 0) { if (getPreventionCardId(cardId) == _gameBoardSide[victimId]._outpostStation[i]._cardId) @@ -5978,11 +5981,18 @@ void Scene1337::handlePlayer1() { for (int j = 0; j <= 3; j++) { //CHECKME: tmpVal or rndVal? + // FIXME: This is probably meant to be rndVal, but not clear... + if (tmpVal < 0 || tmpVal >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::handlePlayer1() tmpVal:%d out of range 0 to %d", tmpVal, ARRAYSIZE(_gameBoardSide)-1); + if (tmpVal != 1) { if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && isAttackPossible(tmpVal, _gameBoardSide[1]._handCard[i]._cardId)) count = tmpVal; } + if (count < 0 || count >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::handlePlayer1() count:%d out of range 0 to %d", count, ARRAYSIZE(_gameBoardSide)-1); + if (count != -1) { playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard); return; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 95f8c85efe..3f32503fdf 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -5048,6 +5048,7 @@ void Scene3700::signal() { Scene3800::Scene3800() { _desertDirection = 0; + _skylineRect.set(0, 0, 320, 87); } void Scene3800::synchronize(Serializer &s) { @@ -5220,7 +5221,8 @@ void Scene3800::initExits() { } void Scene3800::enterArea() { - R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.disableControl(CURSOR_WALK); + switch (_desertDirection) { case 0: R2_GLOBALS._player.postInit(); @@ -5346,7 +5348,6 @@ void Scene3800::postInit(SceneObjectList *OwnerList) { _westExit.setDetails(Rect(0, 87, 14, 168), EXITCURSOR_W, 3800); _westExit.setDest(Common::Point(7, 145)); - _skylineRect.set(0, 0, 320, 87); _background.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *) NULL); enterArea(); diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 6d4ef4ab75..016242edd1 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -1057,7 +1057,7 @@ void SpeakerNej2800::animateSpeaker() { _object1.setup(4023, 3, 1); if (_object2->_visage == 2801) - _object1.setPosition(Common::Point(R2_GLOBALS._player._position.x - 12, R2_GLOBALS._player._position.y)); + _object1.setPosition(Common::Point(_object2->_position.x - 12, _object2->_position.y)); _object1.animate(ANIM_MODE_5, this); } } |