Function updateJump() fix

nextT should cast double as it's a second degree equation and results in a double type. -> Bhaskara.
This commit is contained in:
Okke 2018-08-06 00:08:37 +02:00 committed by GitHub
parent 07b4b785fc
commit a93333ddbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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