aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-04-21 22:13:09 +0200
committerWillem Jan Palenstijn2011-04-21 22:14:05 +0200
commitdda6df668a23cc5c0bb9225f6693b862a3e53d1c (patch)
tree82099b935751fd7257f4038d9bf66bec17a0279d
parent204644b001d85612742426b5731b8149b0a24f2e (diff)
downloadscummvm-rg350-dda6df668a23cc5c0bb9225f6693b862a3e53d1c.tar.gz
scummvm-rg350-dda6df668a23cc5c0bb9225f6693b862a3e53d1c.tar.bz2
scummvm-rg350-dda6df668a23cc5c0bb9225f6693b862a3e53d1c.zip
SCI: Avoid (unused) sqrt of a negative number
This fixes bug #3289799.
-rw-r--r--engines/sci/engine/kmovement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index f93a6716b9..f4392df8f2 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -128,7 +128,7 @@ reg_t kSetJump(EngineState *s, int argc, reg_t *argv) {
debugC(kDebugLevelBresen, "c: %d, tmp: %d", c, tmp);
// Compute x step
- if (tmp != 0)
+ if (tmp != 0 && dx != 0)
vx = (int16)((float)(dx * sqrt(gy / (2.0 * tmp))));
else
vx = 0;