Skip to content

Commit

Permalink
SCI: Avoid (unused) sqrt of a negative number
Browse files Browse the repository at this point in the history
This fixes bug #3289799.
  • Loading branch information
wjp committed Apr 21, 2011
1 parent 204644b commit dda6df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/sci/engine/kmovement.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit dda6df6

Please sign in to comment.