Do the same for chronoshifted units
This commit is contained in:
@@ -119,8 +119,6 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
||||||
var targetUnits = power.UnitsInRange(xy);
|
var targetUnits = power.UnitsInRange(xy);
|
||||||
//foreach (var r in targetUnits.SelectMany(a => a.Render()))
|
|
||||||
// r.Sprite.DrawAt(wr,r.Pos,"highlight");
|
|
||||||
foreach (var unit in targetUnits)
|
foreach (var unit in targetUnits)
|
||||||
wr.DrawSelectionBox(unit, Color.Red);
|
wr.DrawSelectionBox(unit, Color.Red);
|
||||||
}
|
}
|
||||||
@@ -213,6 +211,14 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
// Unit tiles
|
// Unit tiles
|
||||||
foreach (var unit in power.UnitsInRange(sourceLocation))
|
foreach (var unit in power.UnitsInRange(sourceLocation))
|
||||||
|
{
|
||||||
|
var targetCell = unit.Location + xy - sourceLocation;
|
||||||
|
var canEnter = unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell);
|
||||||
|
foreach (var r in unit.Render())
|
||||||
|
r.Sprite.DrawAt(wr, r.Pos - Traits.Util.CenterOfCell(unit.Location) + Traits.Util.CenterOfCell(targetCell),
|
||||||
|
r.Palette ?? unit.Owner.Palette);
|
||||||
|
}
|
||||||
|
foreach (var unit in power.UnitsInRange(sourceLocation))
|
||||||
{
|
{
|
||||||
var targetCell = unit.Location + xy - sourceLocation;
|
var targetCell = unit.Location + xy - sourceLocation;
|
||||||
var canEnter = unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell);
|
var canEnter = unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell);
|
||||||
|
|||||||
Reference in New Issue
Block a user