From e45f4c25afb4eed8b1b44fc201dae7833125cb1d Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Fri, 19 Oct 2007 21:26:05 +0000 Subject: Fixed loadgame bug: old game state wasn't fully wiped out before loading, thus creating bogus game states in memory. As a result, most savefiles should be ditched. A savefile is sure to be safe if it was *never* loaded from in-game, but nothing can be said in the opposite case. svn-id: r29231 --- engines/parallaction/saveload.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 84c376cd8f..4258d4ba41 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -123,6 +123,8 @@ void Parallaction_ns::doLoadGame(uint16 slot) { _engineFlags &= ~kEngineQuit; _numLocations = atoi(s); + memset(_localFlags, 0, sizeof(_localFlags)); + memset(_locationNames, 0, sizeof(_locationNames)); uint16 _si; for (_si = 0; _si < _numLocations; _si++) { @@ -134,7 +136,6 @@ void Parallaction_ns::doLoadGame(uint16 slot) { f->readLine(s, 15); _localFlags[_si] = atoi(s); } - _locationNames[_si][0] = '\0'; cleanInventory(false); ItemName name; -- cgit v1.2.3