aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-08-13 15:57:04 +0000
committerFilippos Karapetis2007-08-13 15:57:04 +0000
commitd5b7a57536065f05e606bf7a3974905d9151f190 (patch)
treea817150ffdc3b6b51c117aa46a3068da8e8f5537
parent985ac6ceaa2a34554d27dc39116559ddae808522 (diff)
downloadscummvm-rg350-d5b7a57536065f05e606bf7a3974905d9151f190.tar.gz
scummvm-rg350-d5b7a57536065f05e606bf7a3974905d9151f190.tar.bz2
scummvm-rg350-d5b7a57536065f05e606bf7a3974905d9151f190.zip
Fix for some cases where the protagonist from some savegames in IHNM was not loaded correctly
svn-id: r28596
-rw-r--r--engines/saga/saveload.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 6f27e1b19b..d04b72f7a8 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -305,11 +305,14 @@ void SagaEngine::load(const char *fileName) {
if (getGameType() != GType_ITE) {
if (_scene->currentProtag() != 0 && _scene->currentChapterNumber() != 6) {
ActorData *actor1 = _actor->getFirstActor();
- // Original stores the current protagonist ID from sfSwapActors:
- //ActorData *actor2 = _actor->getActor(_scene->currentProtag());
- // However, we already store the protagonist, so merely getting the saved
- // protagonist is easier and safer, and works without glitches
- ActorData *actor2 = _actor->_protagonist;
+ ActorData *actor2;
+ // The original gets actor2 from the current protagonist ID, but this is sometimes wrong
+ // If the current protagonist ID is not correct, use the stored protagonist
+ if (!_actor->validActorId(_scene->currentProtag())) {
+ actor2 = _actor->_protagonist;
+ } else {
+ actor2 = _actor->getActor(_scene->currentProtag());
+ }
SWAP(actor1->_location, actor2->_location);