Use decimal instead of float in WVec.LerpQuadratic
To reduce desync risk (without introducing overflow risk).
This commit is contained in:
@@ -82,8 +82,8 @@ namespace OpenRA
|
||||
return ret;
|
||||
|
||||
// Add an additional quadratic variation to height
|
||||
// Uses fp to avoid integer overflow
|
||||
var offset = (int)((float)(b - a).Length * pitch.Tan() * mul * (div - mul) / (1024 * div * div));
|
||||
// Uses decimal to avoid integer overflow
|
||||
var offset = (int)((decimal)(b - a).Length * pitch.Tan() * mul * (div - mul) / (1024 * div * div));
|
||||
return new WVec(ret.X, ret.Y, ret.Z + offset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user