Skip to content

Commit

Permalink
MORTEVIELLE: Fix crash in chartex method for French version
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster authored and Strangerke committed Apr 6, 2012
1 parent fcf07e0 commit d31a85a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions engines/mortevielle/ovd1.cpp
Expand Up @@ -105,21 +105,24 @@ void chartex() {
if (!inpFile.open("TXX.INP")) {
if (!inpFile.open("TXX.MOR")) {
warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
return;
}
} else if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
warning("TXX file - Unexpected format - Switching to DAT file");
}
if (!ntpFile.open("TXX.NTP")) {
warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
return;
} else {
for (int i = 0; i < inpFile.size() / 2; ++i)
g_t_mot[i] = inpFile.readUint16LE();

inpFile.close();
g_vm->_txxFileFl = true;
}

if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
warning("TXX file - Unexpected format - Switching to DAT file");
return;
}

if (!ntpFile.open("TXX.NTP")) {
error("Missing file - TXX.NTP");
}
for (int i = 0; i < inpFile.size() / 2; ++i)
g_t_mot[i] = inpFile.readUint16LE();

inpFile.close();
g_vm->_txxFileFl = true;

for (int i = 0; i < (ntpFile.size() / 3); ++i) {
g_t_rec[i]._indis = ntpFile.readSint16LE();
Expand Down

0 comments on commit d31a85a

Please sign in to comment.