[Scummvm-cvs-logs] scummvm master -> dda6df668a23cc5c0bb9225f6693b862a3e53d1c

wjp wjp at usecode.org
Thu Apr 21 22:16:58 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
dda6df668a SCI: Avoid (unused) sqrt of a negative number


Commit: dda6df668a23cc5c0bb9225f6693b862a3e53d1c
    https://github.com/scummvm/scummvm/commit/dda6df668a23cc5c0bb9225f6693b862a3e53d1c
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-04-21T13:14:05-07:00

Commit Message:
SCI: Avoid (unused) sqrt of a negative number

This fixes bug #3289799.

Changed paths:
    engines/sci/engine/kmovement.cpp



diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index f93a671..f4392df 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;






More information about the Scummvm-git-logs mailing list