aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-10-11 08:00:23 +0200
committerTorbjörn Andersson2015-10-11 08:00:23 +0200
commit0f3e7531c1999da4c424481afd42c5380ec10103 (patch)
tree77e696fc067959cfb7cf6366e26566ff712cb7f3
parent4e6cdf71fb69a9f23ea0c1ec829722248b66c5e4 (diff)
downloadscummvm-rg350-0f3e7531c1999da4c424481afd42c5380ec10103.tar.gz
scummvm-rg350-0f3e7531c1999da4c424481afd42c5380ec10103.tar.bz2
scummvm-rg350-0f3e7531c1999da4c424481afd42c5380ec10103.zip
NEVERHOOD: Possible fix for bad car behaviour
This is something I found when trying the savegame from bug #6932, but I still don't know if it actually is that bug. From what I understand, there are two different cases in the moveCarToPoint() method: One where you click on a different section on a track than you're on, and one where you click on the same section on the track that you're on. In the latter case, it sends message 0x2004 to the car, which is then handled by AsCommonCar::handleMessage(). That one will assume that the parameter is a point, but this can also be encoded as an integer with 16 bits for the X coordinate and 16 bits for the Y coordinate. See MessageParam::asPoint(). If we only pass an X coordinate to the message, the Y coordinate is assumed to be 0, and we do this in a couple of places. I do not know the exact implications of that, but in the two cases I've changed here, it meant that clicking on the track below the car would still make it go up, because it thought you were travelling towards the top of the screen. So I think this is the appropriate fix, but even if it is, I do not know if it's enough or if it should be changed in other places as well.
-rw-r--r--engines/neverhood/modules/module2700.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index a510c02558..8b8bb5c4c4 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -773,7 +773,7 @@ void Scene2702::moveCarToPoint(NPoint pt) {
sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
} else {
_newTrackIndex = -1;
- sendMessage(_asCar, 0x2004, pt.x);
+ sendMessage(_asCar, 0x2004, pt);
}
}
@@ -1099,7 +1099,7 @@ void Scene2706::moveCarToPoint(NPoint pt) {
sendMessage(_asCar, 0x2003, 0);
} else {
_newTrackIndex = -1;
- sendMessage(_asCar, 0x2004, pt.x);
+ sendMessage(_asCar, 0x2004, pt);
}
}