Rename UseOccupiedCellsOffsets to UseTargetableCellsOffsets

With the introduction of the new 'u' BlockingUntargetable cell type, the old property name became inaccurate.
This commit is contained in:
reaperrr
2017-07-05 02:12:52 +02:00
committed by abcdefg30
parent 77ef3a0ed2
commit d95d7e0b0f
11 changed files with 55 additions and 47 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly WVec[] TargetableOffsets = { WVec.Zero };
[Desc("Create a targetable position at the center of each occupied cell. Stacks with TargetableOffsets.")]
public readonly bool UseOccupiedCellsOffsets = false;
public readonly bool UseTargetableCellsOffsets = false;
[FieldLoader.LoadUsing("LoadShape")]
public readonly IHitShape Type;
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits
if (IsTraitDisabled)
yield break;
if (Info.UseOccupiedCellsOffsets && targetableCells != null)
if (Info.UseTargetableCellsOffsets && targetableCells != null)
foreach (var c in targetableCells.TargetableCells())
yield return self.World.Map.CenterOfCell(c.First);

View File

@@ -821,6 +821,14 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// We now differentiate between "occupied and provides offset" and "occupied but provides no offset",
// so the old property name was no longer correct.
if (engineVersion < 20170705)
{
if (node.Key == "UseOccupiedCellsOffsets")
node.Key = "UseTargetableCellsOffsets";
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}