o Fix bug #1258633 "ITE: Second Rif appears in wall of dog castle prison"

o Added debug output method to Location structure
o Fixed long-standing bug with save version being saved not in constant
  endianness

svn-id: r18740
This commit is contained in:
Eugene Sandulenko 2005-09-03 07:56:42 +00:00
parent 720961565a
commit cd5502916a
3 changed files with 18 additions and 3 deletions

View File

@ -2870,6 +2870,14 @@ void Actor::loadState(Common::InSaveFile *in) {
for (i = 0; i < _actorsCount; i++) {
ActorData *a = _actors[i];
a->loadState(_vm->getCurrentLoadVersion(), in);
// Fix bug #1258633 "ITE: Second Rif appears in wall of dog castle prison"
// For some reason in some cases actor position is all wrong, so Rif
// crawls to his original poition
if (i == 122 && _vm->getGameType() == GType_ITE) {
a->_location.x = 130;
a->_location.y = 55;
}
}
for (i = 0; i < _objsCount; i++) {

View File

@ -234,6 +234,10 @@ struct Location {
y = stream.readUint16LE();
z = stream.readUint16LE();
}
void debugPrint(int debuglevel = 0, const char *loc = "Loc:") const {
debug(debuglevel, "%s %d, %d, %d", loc, x, y, z);
}
};
class CommonObjectData {

View File

@ -167,8 +167,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
_saveHeader.type = MKID('SAGA');
_saveHeader.size = 0;
_saveHeader.version = CURRENT_SAGA_VER;
strcpy(_saveHeader.name, saveName);
_saveHeader.version = TO_LE_32(CURRENT_SAGA_VER);
strncpy(_saveHeader.name, saveName, SAVE_TITLE_SIZE);
out->write(&_saveHeader, sizeof(_saveHeader));
@ -204,6 +204,9 @@ void SagaEngine::load(const char *fileName) {
in->read(&_saveHeader, sizeof(_saveHeader));
_saveHeader.size = FROM_LE_32(_saveHeader.size);
_saveHeader.version = FROM_LE_32(_saveHeader.version);
if (_saveHeader.type != MKID('SAGA')) {
error("SagaEngine::load wrong format");
}
@ -235,7 +238,7 @@ void SagaEngine::load(const char *fileName) {
_scene->clearSceneQueue();
_scene->changeScene(sceneNumber, ACTOR_NO_ENTRANCE, kTransitionNoFade);
_events->handleEvents(0); //dissolve back grounds
_events->handleEvents(0); //dissolve backgrounds
if (insetSceneNumber != sceneNumber) {
_render->setFlag(RF_DISABLE_ACTORS);