aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2004-01-08 23:28:29 +0000
committerGregory Montoir2004-01-08 23:28:29 +0000
commitc4e9d55acbcab499cd8b76fcbbacb907a758a05f (patch)
tree6bfced7b09e36c5a53f92f872d2cce8e553dd7da /queen
parent2bc4c1e9cd10bc5a42026f1e0450dd6d39276e09 (diff)
downloadscummvm-rg350-c4e9d55acbcab499cd8b76fcbbacb907a758a05f.tar.gz
scummvm-rg350-c4e9d55acbcab499cd8b76fcbbacb907a758a05f.tar.bz2
scummvm-rg350-c4e9d55acbcab499cd8b76fcbbacb907a758a05f.zip
minor Logic::initPerson() tweak
svn-id: r12270
Diffstat (limited to 'queen')
-rw-r--r--queen/graphics.cpp8
-rw-r--r--queen/logic.cpp7
-rw-r--r--queen/logic.h2
3 files changed, 10 insertions, 7 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index 71cce80d91..56f4813caa 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -1139,7 +1139,9 @@ uint16 Graphics::setupPerson(uint16 noun, uint16 curImage) {
}
Person p;
- _vm->logic()->initPerson(noun, "", true, &p);
+ if (!_vm->logic()->initPerson(noun, "", true, &p)) {
+ return curImage;
+ }
const ActorData *pad = p.actor;
uint16 scale = 100;
@@ -1170,8 +1172,8 @@ uint16 Graphics::setupPerson(uint16 noun, uint16 curImage) {
uint16 Graphics::allocPerson(uint16 noun, uint16 curImage) {
Person p;
- _vm->logic()->initPerson(noun, "", false, &p);
- if (p.anim != NULL) {
+ if (_vm->logic()->initPerson(noun, "", false, &p) && p.anim != NULL) {
+ debug(0, "allocPerson() : anim=%s", p.anim);
curImage += countAnimFrames(p.anim);
_personFrames[p.actor->bobNum] = curImage + 1;
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index ca9bd4442e..72ec87b807 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -572,10 +572,10 @@ ActorData *Logic::findActor(uint16 noun, const char *name) {
}
-void Logic::initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp) {
+bool Logic::initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp) {
if (noun <= 0) {
warning("Logic::initPerson() - Invalid object number: %i", noun);
- }
+ }
ActorData *pad = findActor(noun, actorName);
if (pad != NULL) {
pp->actor = pad;
@@ -591,7 +591,8 @@ void Logic::initPerson(int16 noun, const char *actorName, bool loadBank, Person
// data is already loaded as it is contained in objects room bank (.bbk)
}
pp->bobFrame = 29 + FRAMES_JOE_XTRA + pp->actor->bobNum;
- }
+ }
+ return pad != NULL;
}
diff --git a/queen/logic.h b/queen/logic.h
index 778429fcce..e14c66269f 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -146,7 +146,7 @@ public:
void entryObj(int16 obj) { _entryObj = obj; }
ActorData *findActor(uint16 noun, const char *name = NULL);
- void initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp);
+ bool initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp);
uint16 findPersonNumber(uint16 obj) const;
void loadJoeBanks(const char *animBank, const char *standBank);