Ticket #9233: v0_mm_ObjectFix_WalkFix.patch
File v0_mm_ObjectFix_WalkFix.patch, 3.5 KB (added by , 14 years ago) |
---|
-
actor.cpp
1043 1043 // yDist must be divided by 4, as we are using 8x2 pixels 1044 1044 // blocks for actor coordinates). 1045 1045 int xDist = ABS(x - destX); 1046 int yDist = ABS(y - destY) / 4;1046 int yDist; 1047 1047 int dist; 1048 1048 1049 // MM C64: This fixes the trunk bug (#3070065), as well 1050 // as the fruit bowl, however im not sure if its 1051 // the proper solution or not. 1052 if( g_scumm->_game.version == 0 ) 1053 yDist = ABS(y - destY); 1054 else 1055 yDist = ABS(y - destY) / 4; 1056 1049 1057 if (xDist < yDist) 1050 1058 dist = (xDist >> 1) + yDist; 1051 1059 else … … 1073 1081 abr.x = foundX; 1074 1082 abr.y = foundY; 1075 1083 abr.box = box; 1084 1076 1085 break; 1077 1086 } 1078 1087 if (dist < bestDist) { -
object.cpp
315 315 return -1; 316 316 317 317 for (i = (_numLocalObjects-1); i > 0; i--) { 318 if (_game.version == 0 ) 319 if( _objs[i].flags != _v0ObjectFlag ) 320 continue; 321 318 322 if (_objs[i].obj_nr == object) 319 323 return i; 320 324 } … … 512 516 if (_game.version <= 2 && _objs[i].state & kObjectStateUntouchable) 513 517 continue; 514 518 } 515 519 516 520 b = i; 517 521 do { 518 522 a = _objs[b].parentstate; … … 526 530 #endif 527 531 if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x && 528 532 _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) { 533 // MMC64: Set the object search flag 534 if (_game.version == 0) 535 _v0ObjectFlag = _objs[i].flags; 529 536 if (_game.version == 0 && _v0ObjectIndex) 530 537 return i; 531 538 else -
script_v0.cpp
987 987 void ScummEngine_v0::resetSentence(bool walking) { 988 988 _activeVerb = 13; 989 989 990 if (!walking) { 990 // If the actor is walking, or the screen is a keypad (no sentence verbs/objects are drawn) 991 // Then reset all active objects (stops the radio crash, bug #3077966) 992 if (!walking || !(_userState & 32)) { 993 _v0ObjectFlag = 0; 991 994 _activeInventory = 0; 992 995 _activeObject = 0; 993 996 _activeObject2 = 0; -
script_v2.cpp
1174 1174 int obj; 1175 1175 Actor *a; 1176 1176 1177 _v0ObjectFlag = 0; 1178 1177 1179 a = derefActor(getVarOrDirectByte(PARAM_1), "o2_walkActorToObject"); 1178 1180 obj = getVarOrDirectWord(PARAM_2); 1179 1181 if (whereIsObject(obj) != WIO_NOT_FOUND) { … … 1182 1184 AdjustBoxResult r = a->adjustXYToBeInBox(x, y); 1183 1185 x = r.x; 1184 1186 y = r.y; 1187 1185 1188 a->startWalkActor(x, y, dir); 1186 1189 } 1187 1190 } -
scumm.cpp
145 145 // Init all vars 146 146 _v0ObjectIndex = false; 147 147 _v0ObjectInInventory = false; 148 _v0ObjectFlag = 0; 148 149 _imuse = NULL; 149 150 _imuseDigital = NULL; 150 151 _musicEngine = NULL; -
scumm.h
591 591 592 592 bool _v0ObjectIndex; // V0 Use object index, instead of object number 593 593 bool _v0ObjectInInventory; // V0 Use object number from inventory 594 byte _v0ObjectFlag; 594 595 595 596 /* Global resource tables */ 596 597 int _numVariables, _numBitVariables, _numLocalObjects;