Browse Source

Function updateJump() fix

nextT should cast double as it's a second degree equation and results in a double type. -> Bhaskara.
Okke 1 year ago
parent
commit
a93333ddbf
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/client/creature.cpp

+ 1
- 1
src/client/creature.cpp View File

@@ -405,7 +405,7 @@ void Creature::updateJump()
405 405
 
406 406
         int nextT, i = 1;
407 407
         do {
408
-            nextT = stdext::round((-b + std::sqrt(std::max<int>(b*b + 4*a*(roundHeight+diff*i), 0.0)) * diff) / (2*a));
408
+            nextT = stdext::round((-b + std::sqrt(std::max<double>(b*b + 4*a*(roundHeight+diff*i), 0.0)) * diff) / (2*a));
409 409
             ++i;
410 410
 
411 411
             if(nextT < halfJumpDuration)

Loading…
Cancel
Save