From ba50b42c36d54e5f37987ae13621d2108ae873b9 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Sun, 16 Nov 2003 19:55:04 +0000 Subject: fix 'wrong Joe position when switching from hotel basement to lobby' issue svn-id: r11313 --- queen/cutaway.cpp | 2 ++ queen/logic.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 3f1123ad19..53acb35dd4 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1354,6 +1354,8 @@ void Cutaway::run(char *nextFilename) { _logic->newRoom(_initialRoom); _logic->display()->fullscreen(true); } + _logic->joeX(0); + _logic->joeY(0); } // XXX CUTJOEF=0; diff --git a/queen/logic.cpp b/queen/logic.cpp index bff4ceb4cc..a6ba7565a1 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -1595,6 +1595,8 @@ void Logic::joeSetup() { ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) { // queen.c SETUP_HERO() + debug(0, "Logic::joeSetupInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y); + uint16 oldx; uint16 oldy; WalkOffData *pwo = NULL; @@ -1603,9 +1605,9 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) { error("Logic::joeSetupInRoom() - No object data for obj %d", _entryObj); } - if (!autoPosition || _joe.x != 0 || _joe.y != 0) { - oldx = _joe.x; - oldy = _joe.y; + if (!autoPosition || joeX() != 0 || joeY() != 0) { + oldx = joeX(); + oldy = joeY(); } else { // find the walk off point for the entry object and make @@ -1661,8 +1663,8 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) { pbs->x = oldx; pbs->y = oldy; pbs->frameNum = 29 + FRAMES_JOE_XTRA; - _joe.x = 0; - _joe.y = 0; + joeX(0); + joeY(0); if (pwo != NULL) { // entryObj has a walk off point, then walk from there to object x,y -- cgit v1.2.3