mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-11 03:01:01 +00:00
AGS: Fix crash exiting Mage's Initiation
This commit is contained in:
parent
8ab7d43079
commit
e22a8657ac
@ -60,6 +60,8 @@ int run_claimable_event(const char *tsname, bool includeRoom, int numParams, con
|
|||||||
|
|
||||||
if (includeRoom && _G(roominst)) {
|
if (includeRoom && _G(roominst)) {
|
||||||
toret = RunScriptFunctionIfExists(_G(roominst), tsname, numParams, params);
|
toret = RunScriptFunctionIfExists(_G(roominst), tsname, numParams, params);
|
||||||
|
if (_G(abort_engine))
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (_G(eventClaimed) == EVENT_CLAIMED) {
|
if (_G(eventClaimed) == EVENT_CLAIMED) {
|
||||||
_G(eventClaimed) = eventClaimedOldValue;
|
_G(eventClaimed) = eventClaimedOldValue;
|
||||||
|
@ -553,6 +553,10 @@ static void game_loop_check_controls(bool checkControls) {
|
|||||||
int numevents_was = _G(numevents);
|
int numevents_was = _G(numevents);
|
||||||
check_controls();
|
check_controls();
|
||||||
check_room_edges(numevents_was);
|
check_room_edges(numevents_was);
|
||||||
|
|
||||||
|
if (_G(abort_engine))
|
||||||
|
return;
|
||||||
|
|
||||||
// If an inventory interaction changed the room
|
// If an inventory interaction changed the room
|
||||||
if (inRoom != _G(displayed_room))
|
if (inRoom != _G(displayed_room))
|
||||||
check_new_room();
|
check_new_room();
|
||||||
|
@ -310,6 +310,8 @@ int PrepareTextScript(ccInstance *sci, const char **tsname) {
|
|||||||
_G(ccErrorString) = "script is already in execution";
|
_G(ccErrorString) = "script is already in execution";
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(_G(num_scripts) < MAX_SCRIPT_AT_ONCE);
|
||||||
_G(scripts)[_G(num_scripts)].init();
|
_G(scripts)[_G(num_scripts)].init();
|
||||||
_G(scripts)[_G(num_scripts)].inst = sci;
|
_G(scripts)[_G(num_scripts)].inst = sci;
|
||||||
// CHECKME: this conditional block will never run, because
|
// CHECKME: this conditional block will never run, because
|
||||||
@ -433,7 +435,7 @@ int RunTextScript2IParam(ccInstance *sci, const char *tsname, const RuntimeScrip
|
|||||||
bool eventWasClaimed;
|
bool eventWasClaimed;
|
||||||
int toret = run_claimable_event(tsname, true, 2, params, &eventWasClaimed);
|
int toret = run_claimable_event(tsname, true, 2, params, &eventWasClaimed);
|
||||||
|
|
||||||
if (eventWasClaimed)
|
if (eventWasClaimed || _G(abort_engine))
|
||||||
return toret;
|
return toret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user