SCI: Avoid (unused) sqrt of a negative number

This fixes bug #3289799.
This commit is contained in:
Willem Jan Palenstijn 2011-04-21 22:13:09 +02:00
parent 204644b001
commit dda6df668a

View File

@ -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;