Fix AI air squad misbehaving in TS maps

Change Cpos to Mpos by Pchote
This commit is contained in:
dnqbob
2020-10-11 19:42:53 +08:00
committed by abcdefg30
parent 9ddc9073c2
commit 48f4a98c6a

View File

@@ -67,10 +67,12 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
var columnCount = (map.MapSize.X + dangerRadius - 1) / dangerRadius;
var rowCount = (map.MapSize.Y + dangerRadius - 1) / dangerRadius;
var checkIndices = Exts.MakeArray(columnCount * rowCount, i => i).Shuffle(owner.World.LocalRandom);
foreach (var i in checkIndices)
{
var pos = new CPos((i % columnCount) * dangerRadius + dangerRadius / 2, (i / columnCount) * dangerRadius + dangerRadius / 2);
var pos = new MPos((i % columnCount) * dangerRadius + dangerRadius / 2, (i / columnCount) * dangerRadius + dangerRadius / 2).ToCPos(map);
if (NearToPosSafely(owner, map.CenterOfCell(pos), out detectedEnemyTarget))
{
if (needTarget && detectedEnemyTarget == null)