fixed bug #1620023 (script calls putActorAtXY with y == -1)

svn-id: r24910
This commit is contained in:
Gregory Montoir 2006-12-21 15:09:13 +00:00
parent e6f95af215
commit cfd4ffb321
4 changed files with 18 additions and 16 deletions

View File

@ -878,13 +878,6 @@ void ScummEngine::putActors() {
}
void Actor::putActor(int dstX, int dstY, int newRoom) {
if (dstX == -1)
dstX = _pos.x;
if (dstY == -1)
dstY = _pos.y;
if (newRoom == -1)
newRoom = _room;
if (_visible && _vm->_currentRoom != newRoom && _vm->getTalkingActor() == _number) {
_vm->stopTalk();
}
@ -1712,7 +1705,7 @@ void ScummEngine::setTalkingActor(int value) {
// Work out the screen co-ordinates of the actor
int x = _actors[value].getPos().x - (camera._cur.x - (_screenWidth >> 1));
int y = _actors[value]._top - (camera._cur.y - (_screenHeight >> 1));
// Set the focus area to the calculated position
// TODO: Make the size adjust depending on what it's focusing on.
Common::Rect rect(x - 96, y - 64, x + 96, y + 64);

View File

@ -153,17 +153,17 @@ protected:
Common::Point dest; // Final destination point
byte destbox; // Final destination box
int16 destdir; // Final destination, direction to face at
Common::Point cur; // Last position
byte curbox; // Last box
Common::Point next; // Next position on our way to the destination, i.e. our intermediate destination
Common::Point point3;
int32 deltaXFactor, deltaYFactor;
uint16 xfrac, yfrac;
};
byte _palette[256];
int _elevation;
@ -186,7 +186,16 @@ public:
void showActor();
void initActor(int mode);
void putActor(int x = -1, int y = -1, int room = -1);
void putActor() {
putActor(_pos.x, _pos.y, _room);
}
void putActor(int x, int y) {
putActor(x, y, _room);
}
void putActor(int x, int y, int room);
void setActorWalkSpeed(uint newSpeedX, uint newSpeedY);
protected:
int calcMovementFactor(const Common::Point& next);

View File

@ -383,11 +383,11 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
a->_ignoreBoxes = (value > 0);
DebugPrintf("Actor[%d].ignoreBoxes = %d\n", actnum, a->_ignoreBoxes);
} else if (!strcmp(argv[2], "x")) {
a->putActor(value, -1, -1);
a->putActor(value, a->getPos().y, a->_room);
DebugPrintf("Actor[%d].x = %d\n", actnum, a->getPos().x);
_vm->_fullRedraw = true;
} else if (!strcmp(argv[2], "y")) {
a->putActor(-1, value, -1);
a->putActor(a->getPos().x, value, a->_room);
DebugPrintf("Actor[%d].y = %d\n", actnum, a->getPos().y);
_vm->_fullRedraw = true;
} else if (!strcmp(argv[2], "_elevation")) {

View File

@ -749,7 +749,7 @@ void ScummEngine_c64::o_putActorAtObject() {
y = 60;
}
a->putActor(x, y);
a->putActor(x, y, a->_room);
}
void ScummEngine_c64::o_pickupObject() {