[Scummvm-git-logs] scummvm master -> 46eeb0aa2a2b061771b8a53fb741a63a476e9398

dreammaster dreammaster at scummvm.org
Sun Jul 11 03:24:42 UTC 2021


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:
46eeb0aa2a AGS: Fix crash quitting app when speech dialog is active


Commit: 46eeb0aa2a2b061771b8a53fb741a63a476e9398
    https://github.com/scummvm/scummvm/commit/46eeb0aa2a2b061771b8a53fb741a63a476e9398
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-10T20:23:52-07:00

Commit Message:
AGS: Fix crash quitting app when speech dialog is active

Changed paths:
    engines/ags/engine/ac/character.cpp
    engines/ags/engine/ac/dialog.cpp
    engines/ags/engine/main/game_run.cpp
    engines/ags/engine/script/script.cpp
    engines/ags/events.cpp


diff --git a/engines/ags/engine/ac/character.cpp b/engines/ags/engine/ac/character.cpp
index 4ed75fba54..d8b48dbf85 100644
--- a/engines/ags/engine/ac/character.cpp
+++ b/engines/ags/engine/ac/character.cpp
@@ -2673,6 +2673,9 @@ void _displayspeech(const char *texx, int aschar, int xx, int yy, int widd, int
 
 	_G(our_eip) = 155;
 	_display_at(tdxp, tdyp, bwidth, texx, DISPLAYTEXT_SPEECH, textcol, isThought, allowShrink, overlayPositionFixed);
+	if (_G(abort_engine))
+		return;
+
 	_G(our_eip) = 156;
 	if ((_GP(play).in_conversation > 0) && (_GP(game).options[OPT_SPEECHTYPE] == 3))
 		closeupface = nullptr;
diff --git a/engines/ags/engine/ac/dialog.cpp b/engines/ags/engine/ac/dialog.cpp
index 9673eb633d..b53b709bdd 100644
--- a/engines/ags/engine/ac/dialog.cpp
+++ b/engines/ags/engine/ac/dialog.cpp
@@ -290,7 +290,7 @@ int run_dialog_script(DialogTopic *dtpp, int dialogID, int offse, int optionInde
 		}
 	}
 
-	if (_G(in_new_room) > 0)
+	if (_G(in_new_room) > 0 || _G(abort_engine))
 		return RUN_DIALOG_STOP_DIALOG;
 
 	if (_G(said_speech_line) > 0) {
diff --git a/engines/ags/engine/main/game_run.cpp b/engines/ags/engine/main/game_run.cpp
index c0af5bd89b..02ef458ed5 100644
--- a/engines/ags/engine/main/game_run.cpp
+++ b/engines/ags/engine/main/game_run.cpp
@@ -769,6 +769,8 @@ void UpdateGameOnce(bool checkControls, IDriverDependantBitmap *extraBitmap, int
 	_G(our_eip) = 7;
 
 	update_polled_stuff_if_runtime();
+	if (_G(abort_engine))
+		return;
 
 	game_loop_update_background_animation();
 
@@ -783,6 +785,8 @@ void UpdateGameOnce(bool checkControls, IDriverDependantBitmap *extraBitmap, int
 	game_loop_update_fps();
 
 	update_polled_stuff_if_runtime();
+	if (_G(abort_engine))
+		return;
 
 	WaitForNextFrame();
 }
@@ -993,9 +997,8 @@ void update_polled_stuff_if_runtime() {
 	if (_G(want_exit)) {
 		_G(want_exit) = 0;
 		quit("||exit!");
-	}
 
-	if (_G(editor_debugging_initialized))
+	} else if (_G(editor_debugging_initialized))
 		check_for_messages_from_editor();
 }
 
diff --git a/engines/ags/engine/script/script.cpp b/engines/ags/engine/script/script.cpp
index b748fe10ca..ff5ece96c6 100644
--- a/engines/ags/engine/script/script.cpp
+++ b/engines/ags/engine/script/script.cpp
@@ -543,7 +543,7 @@ void post_script_cleanup() {
 			quitprintf("undefined post script action found: %d", copyof.postScriptActions[ii]);
 		}
 		// if the room changed in a conversation, for example, abort
-		if (old_room_number != _G(displayed_room)) {
+		if (old_room_number != _G(displayed_room) || _G(abort_engine)) {
 			return;
 		}
 	}
diff --git a/engines/ags/events.cpp b/engines/ags/events.cpp
index 4928556ba0..55e2ebb91c 100644
--- a/engines/ags/events.cpp
+++ b/engines/ags/events.cpp
@@ -49,7 +49,7 @@ void EventsManager::pollEvents() {
 			_G(want_exit) = true;
 			_G(abort_engine) = true;
 			_G(check_dynamic_sprites_at_exit) = false;
-			break;
+			return;
 
 		case Common::EVENT_JOYAXIS_MOTION:
 			assert(e.joystick.axis < 32);




More information about the Scummvm-git-logs mailing list