[Scummvm-git-logs] scummvm master -> 44828747f472cd7d069147d7f655689877a14821
dreammaster
dreammaster at scummvm.org
Sat Jun 26 05:29:46 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b7c91379b6 AGS: Fix crash in Captain Disaster walking to Aquarium
44828747f4 AGS: Fix crash quitting Whispers of a Machine from main menu
Commit: b7c91379b69723233594b550db8cf8fe98fd862c
https://github.com/scummvm/scummvm/commit/b7c91379b69723233594b550db8cf8fe98fd862c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-06-25T22:29:34-07:00
Commit Message:
AGS: Fix crash in Captain Disaster walking to Aquarium
Changed paths:
engines/ags/engine/ac/math.cpp
diff --git a/engines/ags/engine/ac/math.cpp b/engines/ags/engine/ac/math.cpp
index e07c6b3c8c..f157cfa7e4 100644
--- a/engines/ags/engine/ac/math.cpp
+++ b/engines/ags/engine/ac/math.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "common/config-manager.h"
#include "ags/engine/ac/math.h"
#include "ags/shared/ac/common.h" // quit
#include "ags/shared/util/math.h"
@@ -40,7 +41,7 @@ int FloatToInt(float value, int roundDirection) {
else if (roundDirection == eRoundUp)
return static_cast<int>(value + 0.999999);
else
- quit("!FloatToInt: invalid round direction");
+ error("!FloatToInt: invalid round direction");
} else {
// negative number
if (roundDirection == eRoundUp)
@@ -50,7 +51,7 @@ int FloatToInt(float value, int roundDirection) {
else if (roundDirection == eRoundDown)
return static_cast<int>(value - 0.999999);
else
- quit("!FloatToInt: invalid round direction");
+ error("!FloatToInt: invalid round direction");
}
return 0;
}
@@ -133,14 +134,20 @@ float Math_GetPi() {
float Math_Sqrt(float value) {
if (value < 0.0)
- quit("!Sqrt: cannot perform square root of negative number");
+ error("!Sqrt: cannot perform square root of negative number");
return ::sqrt(value);
}
int __Rand(int upto) {
+ // WORKAROUND: Fix crash in Captain Disaster in Death Has a Million Stomping Boots
+ // at the start of Act 2, walking to Aquarium
+ if (upto == -1 && ConfMan.get("gameid") == "captaindisaster")
+ upto = INT32_MAX;
+
if (upto < 0)
- quit("!Random: invalid parameter passed -- must be at least 0.");
+ error("!Random: invalid parameter passed -- must be at least 0.");
+
return ::AGS::g_vm->getRandomNumber(upto);
}
Commit: 44828747f472cd7d069147d7f655689877a14821
https://github.com/scummvm/scummvm/commit/44828747f472cd7d069147d7f655689877a14821
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-06-25T22:29:35-07:00
Commit Message:
AGS: Fix crash quitting Whispers of a Machine from main menu
Changed paths:
engines/ags/engine/main/game_run.cpp
engines/ags/engine/script/script.cpp
diff --git a/engines/ags/engine/main/game_run.cpp b/engines/ags/engine/main/game_run.cpp
index 61df73ec54..0563de19f5 100644
--- a/engines/ags/engine/main/game_run.cpp
+++ b/engines/ags/engine/main/game_run.cpp
@@ -726,6 +726,8 @@ void UpdateGameOnce(bool checkControls, IDriverDependantBitmap *extraBitmap, int
_G(our_eip) = 1004;
game_loop_check_new_room();
+ if (_G(abort_engine))
+ return;
_G(our_eip) = 1005;
diff --git a/engines/ags/engine/script/script.cpp b/engines/ags/engine/script/script.cpp
index f2d023bc26..b748fe10ca 100644
--- a/engines/ags/engine/script/script.cpp
+++ b/engines/ags/engine/script/script.cpp
@@ -97,7 +97,7 @@ void run_function_on_non_blocking_thread(NonBlockingScriptFunction *funcToRun) {
funcToRun->globalScriptHasFunction = DoRunScriptFuncCantBlock(_G(gameinstFork), funcToRun, funcToRun->globalScriptHasFunction);
- if (room_changes_was != _GP(play).room_changes)
+ if (room_changes_was != _GP(play).room_changes || _G(abort_engine))
return;
funcToRun->roomHasFunction = DoRunScriptFuncCantBlock(_G(roominstFork), funcToRun, funcToRun->roomHasFunction);
@@ -281,8 +281,12 @@ bool DoRunScriptFuncCantBlock(ccInstance *sci, NonBlockingScriptFunction *funcTo
if (funcToRun->numParameters < 3) {
result = sci->CallScriptFunction((const char *)funcToRun->functionName, funcToRun->numParameters, funcToRun->params);
- } else
+ } else {
quit("DoRunScriptFuncCantBlock called with too many parameters");
+ }
+
+ if (_G(abort_engine))
+ return false;
if (result == -2) {
// the function doens't exist, so don't try and run it again
@@ -292,6 +296,7 @@ bool DoRunScriptFuncCantBlock(ccInstance *sci, NonBlockingScriptFunction *funcTo
} else {
funcToRun->atLeastOneImplementationExists = true;
}
+
// this might be nested, so don't disrupt blocked scripts
_G(ccErrorString) = "";
_G(ccError) = 0;
More information about the Scummvm-git-logs
mailing list