aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kmath.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp
index 6d4b9a2a04..3c0ab814f1 100644
--- a/engines/sci/engine/kmath.cpp
+++ b/engines/sci/engine/kmath.cpp
@@ -36,9 +36,12 @@ reg_t kRandom(EngineState *s, int argc, reg_t *argv) {
}
reg_t kAbs(EngineState *s, int argc, reg_t *argv) {
- // This is a hack, but so is the code in Hoyle1 that needs it.
- if (argv[0].segment)
- return make_reg(0, 0x3e9); // Yes people, this is an object
+ if (g_sci->getGameId() == GID_HOYLE1) {
+ // This is a hack, but so is the code in Hoyle1 that needs it.
+ // FIXME: where is this exactly needed?
+ if (argv[0].segment)
+ return make_reg(0, 0x3e9); // Yes people, this is an object
+ }
return make_reg(0, abs(argv[0].toSint16()));
}