[Scummvm-git-logs] scummvm master -> 57c18514be33e9f488f9e5d68fc60bfaca67063c

dreammaster noreply at scummvm.org
Fri Jul 14 01:40:55 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
57c18514be ULTIMA4: Fix crash when pressing ESC after Cast


Commit: 57c18514be33e9f488f9e5d68fc60bfaca67063c
    https://github.com/scummvm/scummvm/commit/57c18514be33e9f488f9e5d68fc60bfaca67063c
Author: Steve Dunham (dunhamsteve at gmail.com)
Date: 2023-07-13T18:40:51-07:00

Commit Message:
ULTIMA4: Fix crash when pressing ESC after Cast

If user presses esc while selecting a character the controller
returns -22 instead of the expected -1. This led to an out of bounds
array reference and a crash.

Changed paths:
    engines/ultima/ultima4/controllers/read_player_controller.cpp


diff --git a/engines/ultima/ultima4/controllers/read_player_controller.cpp b/engines/ultima/ultima4/controllers/read_player_controller.cpp
index 38d6d5a3e48..4673d7bd8df 100644
--- a/engines/ultima/ultima4/controllers/read_player_controller.cpp
+++ b/engines/ultima/ultima4/controllers/read_player_controller.cpp
@@ -51,7 +51,7 @@ bool ReadPlayerController::keyPressed(int key) {
 }
 
 int ReadPlayerController::getPlayer() {
-	return _value - '1';
+	return _value == 27 ? -1 : _value - '1';
 }
 
 int ReadPlayerController::waitFor() {




More information about the Scummvm-git-logs mailing list