(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.

This commit is contained in:
frosch
2010-04-18 14:56:05 +00:00
parent 2330851d1d
commit 2e90f7f8b9
15 changed files with 50 additions and 30 deletions

View File

@@ -1061,7 +1061,7 @@ static bool AircraftController(Aircraft *v)
/* Only start lowering when we're sufficiently close for a 1:1 glide */
if (delta >= t) {
z -= ((z - curz) + t - 1) / t;
z -= CeilDiv(z - curz, t);
}
if (z < curz) z = curz;
}