Reverted the recent o5_getClosestObjActor() change and fixed it by

measuring the distance in characters for V2 games instead. Now Edna won't
bring the same strange kid into the cell over and over again.

If necessary, we can still fix o5_getClosestActor() to handle larger
distances. It just takes a few more changes than I first thought.

svn-id: r8243
This commit is contained in:
Torbjörn Andersson 2003-06-01 16:40:15 +00:00
parent ed0080e55b
commit 7cfe07fdd3
2 changed files with 11 additions and 5 deletions

View File

@ -288,7 +288,7 @@ int Scumm::getObjActToObjActDist(int a, int b) {
if (y > x)
x = y;
return x;
return (_features & GF_AFTER_V2) ? x / 8 : x;
}
int Scumm::findObject(int x, int y) {

View File

@ -1031,9 +1031,18 @@ void Scumm_v5::o5_getAnimCounter() {
void Scumm_v5::o5_getClosestObjActor() {
int obj;
int act;
int closest_obj = 0xFF, closest_dist = 0xFFFF;
int dist;
// This is a bit odd: We can't detect any actors farther away than
// 255 units (pixels in newer games, characters in older ones.) To
// fix this, we also need to change getObjActToObjActDist(), since
// it returns 255 to indicate that it can't find the actor, and make
// sure we don't break o5_getDist() in the process.
//
// But we probably won't have to.
int closest_obj = 0xFF, closest_dist = 0xFF;
getResultPos();
act = getVarOrDirectWord(0x80);
@ -1062,9 +1071,6 @@ void Scumm_v5::o5_getDist() {
if (_gameId == GID_MONKEY2 && vm.slot[_currentScript].number == 40 && r < 60)
r = 60;
if (_features & GF_AFTER_V2)
r /= 8;
setResult(r);
}