diff options
author | Willem Jan Palenstijn | 2011-04-21 22:13:09 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-04-21 22:14:05 +0200 |
commit | dda6df668a23cc5c0bb9225f6693b862a3e53d1c (patch) | |
tree | 82099b935751fd7257f4038d9bf66bec17a0279d | |
parent | 204644b001d85612742426b5731b8149b0a24f2e (diff) | |
download | scummvm-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.cpp | 2 |
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; |