aboutsummaryrefslogtreecommitdiff
path: root/saga/sthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'saga/sthread.cpp')
-rw-r--r--saga/sthread.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index c5f1f74a3a..209c6ebb6f 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -317,7 +317,8 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
CASEOP(opCcallV)
argumentsCount = scriptS.readByte();
functionNumber = scriptS.readUint16LE();
- if (functionNumber >= SCRIPT_FUNCTION_MAX) {
+ if (functionNumber >= (_vm->getGameType() == GType_IHNM) ?
+ IHNM_SCRIPT_FUNCTION_MAX : ITE_SCRIPT_FUNCTION_MAX) {
error("Script::runThread() Invalid script function number (%d)", functionNumber);
}