Fix RCS1118

This commit is contained in:
RoosterDragon
2023-03-18 12:58:22 +00:00
committed by Gustas
parent eb287d9b8d
commit fbe147ce61
11 changed files with 115 additions and 107 deletions

View File

@@ -496,8 +496,8 @@ namespace OpenRA.Mods.Common.Projectiles
lastHt = 0; // Height just before the last height change
// NOTE: Might be desired to unhardcode the lookahead step size
var stepSize = 32;
var step = new WVec(0, -stepSize, 0)
const int StepSize = 32;
var step = new WVec(0, -StepSize, 0)
.Rotate(new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(hFacing))); // Step vector of length 128
// Probe terrain ahead of the missile
@@ -505,7 +505,7 @@ namespace OpenRA.Mods.Common.Projectiles
var maxLookaheadDistance = loopRadius * 4;
var posProbe = pos;
var curDist = 0;
var tickLimit = System.Math.Min(maxLookaheadDistance, distCheck) / stepSize;
var tickLimit = System.Math.Min(maxLookaheadDistance, distCheck) / StepSize;
var prevHt = 0;
// TODO: Make sure cell on map!!!
@@ -517,7 +517,7 @@ namespace OpenRA.Mods.Common.Projectiles
var ht = world.Map.Height[world.Map.CellContaining(posProbe)] * 512;
curDist += stepSize;
curDist += StepSize;
if (ht > predClfHgt)
{
predClfHgt = ht;