Remove desyncing fp from WPos.LerpQuadratic. Fixes #3966.

This commit is contained in:
Paul Chote
2013-10-22 22:22:09 +13:00
parent c5c518dbce
commit 76c8c8806e

View File

@@ -47,8 +47,8 @@ namespace OpenRA
return ret; return ret;
// Add an additional quadratic variation to height // Add an additional quadratic variation to height
// Uses fp to avoid integer overflow // Attempts to avoid integer overflow by keeping the intermediate variables reasonably sized
var offset = (int)((float)((float)(b - a).Length*pitch.Tan()*mul*(div - mul)) / (float)(1024*div*div)); var offset = (int)(((((((long)(b - a).Length * mul) / div) * (div - mul)) / div) * pitch.Tan()) / 1024);
return new WPos(ret.X, ret.Y, ret.Z + offset); return new WPos(ret.X, ret.Y, ret.Z + offset);
} }