Skip to content

Commit

Permalink
SHERLOCK: Fix paging to end of journal
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Apr 25, 2015
1 parent c6286ec commit eb91c01
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions engines/sherlock/journal.cpp
Expand Up @@ -51,7 +51,6 @@ const int SEARCH_POINTS[3][3] = {

Journal::Journal(SherlockEngine *vm): _vm(vm) {
// Initialize fields
_count = 0;
_maxPage = 0;
_index = 0;
_sub = 0;
Expand Down Expand Up @@ -679,7 +678,7 @@ bool Journal::doJournal(int direction, int howFar) {
if (++_sub == maxLines) {
// Reached end of page
do {
if (++_index == _count) {
if (++_index == (int)_journal.size()) {
_index = savedIndex;
_sub = savedSub;
maxLines = loadJournalFile(false);
Expand Down Expand Up @@ -1192,7 +1191,6 @@ void Journal::resetPosition() {
* Synchronize the data for a savegame
*/
void Journal::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_count);
s.syncAsSint16LE(_index);
s.syncAsSint16LE(_sub);
s.syncAsSint16LE(_page);
Expand Down
1 change: 0 additions & 1 deletion engines/sherlock/journal.h
Expand Up @@ -50,7 +50,6 @@ class Journal {
Common::StringArray _directory;
Common::StringArray _locations;
Common::StringArray _lines;
int _count;
int _maxPage;
int _index;
int _sub;
Expand Down

0 comments on commit eb91c01

Please sign in to comment.