From b23fd8c3345009e8b107695128ea29f7feaed783 Mon Sep 17 00:00:00 2001 From: Matthew Duggan Date: Sat, 25 Jun 2022 10:45:42 +0900 Subject: [PATCH] ULTIMA8: Expand comments on a couple of U8 script fixes. Not sure how long sourceforge bugtracker for Pentagram will exist so nice to document the reason for the workaround in the code. --- engines/ultima/ultima8/usecode/uc_machine.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp index 40e6929cf4a..97ffd9bf525 100644 --- a/engines/ultima/ultima8/usecode/uc_machine.cpp +++ b/engines/ultima/ultima8/usecode/uc_machine.cpp @@ -317,9 +317,9 @@ void UCMachine::execProcess(UCProcess *p) { cs->read(str, ui16a); str[ui16a] = 0; - // REALLY MAJOR HACK: - // see docs/u8bugs.txt and - // https://sourceforge.net/p/pentagram/bugs/196/ + // WORKAROUND: German U8: When the candles are not in the right positions + // for a sorcery spell, the string does not match, causing a crash. + // Original bug: https://sourceforge.net/p/pentagram/bugs/196/ if (GAME_IS_U8 && p->_classId == 0x7C) { if (!strcmp(str, " Irgendetwas stimmt nicht!")) { str[25] = '.'; // ! to . @@ -410,9 +410,12 @@ void UCMachine::execProcess(UCProcess *p) { delete[] argbuf; } - // REALLY MAJOR HACK: - // see docs/u8bugs.txt and - // https://sourceforge.net/p/pentagram/feature-requests/6/ + // WORKAROUND: In U8, the flag 'startedConvo' [0000 01] which acts + // as a mutex is set too late in the script, allowing two copies of + // of the Ancient Ones script (each spawned by a different egg) to + // run simultaneously. Set the flag when the avatar is put in stasis + // to avoid this. + // Original bug: https://sourceforge.net/p/pentagram/feature-requests/6/ if (GAME_IS_U8 && p->_classId == 0x48B && func == 0xD0) { // 0xD0 = setAvatarInStasis _globals->setEntries(0, 1, 1);