aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/script.cpp')
-rw-r--r--engines/cruise/script.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index 75cf428787..764a458b8f 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -415,7 +415,9 @@ int32 opcodeType3() { // math
return (0);
}
case 1: {
- pushVar(pop1 / (pop2 == 0 ? 1 : pop2));
+ if (pop2 == 0)
+ error("opcodeType3 - Invalid value for pop2");
+ pushVar(pop1 / pop2);
return (0);
}
case 2: {
@@ -427,7 +429,9 @@ int32 opcodeType3() { // math
return (0);
}
case 4: {
- pushVar(pop1 % (pop2 == 0 ? 1 : pop2));
+ if (pop2 == 0)
+ error("opcodeType3 - Invalid value for pop2");
+ pushVar(pop1 % pop2);
return (0);
}
case 7: