aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--queen/graphics.cpp2
-rw-r--r--queen/logic.cpp10
-rw-r--r--queen/logic.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index 44bf4add97..aac0872abd 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -783,7 +783,7 @@ uint16 Graphics::refreshObject(uint16 obj) {
pbs->clear();
} else {
// find person number
- uint16 pNum = _vm->logic()->findPersonNumber(obj);
+ uint16 pNum = _vm->logic()->findPersonNumber(obj, _vm->logic()->currentRoom());
curImage = _personFrames[pNum] - 1;
if (_personFrames[pNum] == 0) {
_personFrames[pNum] = curImage = _numFrames;
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 7eb5617eeb..c4d218dc46 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -267,7 +267,7 @@ uint16 Logic::findBob(uint16 obj) {
if(img != 0) {
if(img == -3 || img == -4) {
// a person object
- bobnum = findPersonNumber(obj);
+ bobnum = findPersonNumber(obj, room);
} else {
uint16 bobtype = 0; // 1 for animated, 0 for static
@@ -337,7 +337,7 @@ uint16 Logic::findFrame(uint16 obj) {
uint16 room = _objectData[obj].room;
int16 img = _objectData[obj].image;
if(img == -3 || img == -4) {
- uint16 bobnum = findPersonNumber(obj);
+ uint16 bobnum = findPersonNumber(obj, room);
if(bobnum <= 3) {
framenum = 29 + FRAMES_JOE_XTRA + bobnum;
}
@@ -538,7 +538,7 @@ ActorData *Logic::findActor(uint16 noun, const char *name) const {
}
// search Bob number for the person
- uint16 bobNum = findPersonNumber(obj);
+ uint16 bobNum = findPersonNumber(obj, _currentRoom);
// search for a matching actor
if (bobNum > 0) {
@@ -575,10 +575,10 @@ bool Logic::initPerson(uint16 noun, const char *actorName, bool loadBank, Person
return pad != NULL;
}
-uint16 Logic::findPersonNumber(uint16 obj) const {
+uint16 Logic::findPersonNumber(uint16 obj, uint16 room) const {
uint16 num = 0;
uint16 i;
- for (i = currentRoomData() + 1; i <= obj; ++i) {
+ for (i = _roomData[room] + 1; i <= obj; ++i) {
int16 img = _objectData[i].image;
if (img == -3 || img == -4) {
++num;
diff --git a/queen/logic.h b/queen/logic.h
index 4a83d07a2f..b61d06d6cd 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -130,7 +130,7 @@ public:
ActorData *findActor(uint16 noun, const char *name = NULL) const;
bool initPerson(uint16 noun, const char *actorName, bool loadBank, Person *pp);
- uint16 findPersonNumber(uint16 obj) const;
+ uint16 findPersonNumber(uint16 obj, uint16 room) const;
void loadJoeBanks(const char *animBank, const char *standBank);