Skip to content

Commit

Permalink
SCI: Fix crash in Island of Dr. Brain microscope puzzle - bug 14546
Browse files Browse the repository at this point in the history
When clicking "buy clue" in the microscope puzzle, the game could crash with a division by zero in
cartesian:buyClue, depending on the initialization of the puzzle itself. Because the initialization is
random and non-deterministic, this crash would only occur very rarely
  • Loading branch information
deckarep authored Sep 30, 2023
1 parent ff8fdf8 commit eeddc6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions engines/sci/engine/workarounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_HOYLE5, -1, 6000, 1, "sHand", "handleEvent", nullptr, 4, 4, { WORKAROUND_FAKE, 0 } }, // Solitaire: when clicking on an empty card base in any game
{ GID_ISLANDBRAIN, 100, 937, 0, "IconBar", "dispatchEvent", nullptr, 58, 58, { WORKAROUND_FAKE, 0 } }, // when using ENTER at the startup menu - bug #5241
{ GID_ISLANDBRAIN, 140, 140, 0, "piece", "init", nullptr, 3, 3, { WORKAROUND_FAKE, 1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
{ GID_ISLANDBRAIN, 160, 165, 0, "cartesian", "buyClue", nullptr, 0, 0, { WORKAROUND_FAKE, 1 } }, // microscope puzzle: upon click of buy clue - depends on non-deterministic initialization for puzzle. Before div occurs, temp0 must be non-0 - bug #14546
{ GID_ISLANDBRAIN, 180, 190, 0, "word", "dispatchEvent", nullptr, 14, 15, { WORKAROUND_FAKE, 0 } }, // holding down enter key during the word search puzzle, temps 14 and 15
{ GID_ISLANDBRAIN, 200, 268, 0, "anElement", "select", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // elements puzzle, gets used before super TextIcon
{ GID_JONES, 1, 232, 0, "weekendText", "draw", sig_uninitread_jones_1, 0, 0, { WORKAROUND_FAKE, 0 } }, // jones/cd only - gets called during the game
Expand Down

0 comments on commit eeddc6f

Please sign in to comment.