GOB: work around an infinite loop issue in Adibou 2 "change CD" screen

It seems that this bug is harmless in the original game because it requires a certain combination of files to be present in the CD, which is not the case in practice in Adibou2 CDs ; but it exists for us because our fake "CD" search includes all files in game directory and sub-directories.
This commit is contained in:
Simon Delamarre 2022-10-29 00:43:41 +02:00 committed by Eugene Sandulenko
parent 709df52d48
commit 9beca4c206
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -1408,7 +1408,15 @@ void Inter_v7::o7_checkData(OpFuncParams &params) {
file.c_str(), size);
WRITE_VAR_OFFSET(varOff, handle);
WRITE_VAR(16, (uint32) size);
if (_vm->getGameType() == kGameTypeAdibou2
&&
_vm->isCurrentTot("BE_CD.TOT")) {
// WORKAROUND: in script BE_CD.TOT of Adibou 2, o7_checkData() can be called in the "leave" callback of a hotspot.
// This corrupts the "current hotspot" variable, which is also VAR(16) (!), and lead to an infinite loop.
// We skip writing the file size into VAR(16) here as a workarond (the value is not used anyway).
}
else
WRITE_VAR(16, (uint32) size);
}
void Inter_v7::o7_readData(OpFuncParams &params) {