[Scummvm-tracker] [ScummVM :: Bugs] #10737: AGI: DG: The AGIMouse Adventure (Fan Game) freeze
ScummVM :: Bugs
trac at scummvm.org
Sat Mar 2 19:37:18 UTC 2024
#10737: AGI: DG: The AGIMouse Adventure (Fan Game) freeze
--------------------+--------------------------
Reporter: raziel- | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: AGI
Version: | Resolution:
Keywords: | Game: AGI Fanmade
--------------------+--------------------------
Comment (by sluicebox):
This is a bug in our AGIMOUSE implementation. It is unrelated to picture
drawing, but it *is* related to event processing, which is why the earlier
patch happened to exit the infinite loop even though that patch is in an
unrelated area of code.
This is not a script bug; this infinite loop would have happened even with
the sample AGIMOUSE script that Brian provided in 2001:
https://web.archive.org/web/20011127012952/http://agisci.cjb.net/
{{{
// Is mouse in the area of the button?
if(mouse_y > 32 && mouse_y < 68 && mouse_x > 56 && mouse_x < 103) {
// Is the mouse button pressed
if(mouse_button == mb_left) {
// If it is, draw the mouse button down, then jump to room 3
set.loop(o2,2);
new.room(3);
} else {
// Otherwise, draw the button as a mouse over graphic
set.loop(o2,1);
}
} else {
// Draw the mouse button in normal state
set.loop(o2,0);
}
draw(o2);
}}}
The problem is that we are not updating mouse state when changing rooms;
specifically, the mouse button state. Just like the sample code above,
this game checks to see if the mouse is clicked over a button, and if so,
it calls new.room. We don't reset the button state, so it sees the same
click on the next cycle, calls new.room again, ......
Investigating this five year old ticket led me to discover that we apply
AGIMOUSE behavior to all games, even if they don't use AGIMOUSE. "Won't
that break other games?" It sure will! It's the cause of this three year
old ticket where Phil's Quest instantly game-overs: #12747 .
The solution will be to either update input on new.room, or to reset the
mouse state on new.room, or something like that. I have an AGIMOUSE PR
pending for the other bug, and once that's done I'll continue with this.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10737#comment:16>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list