fixed 850 -- rallypoint flags staying original owner's color after capture
This commit is contained in:
@@ -12,7 +12,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Effects;
|
using OpenRA.Effects;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Mods.RA;
|
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA.Effects
|
namespace OpenRA.Mods.RA.Effects
|
||||||
@@ -23,13 +22,11 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
RA.RallyPoint rp;
|
RA.RallyPoint rp;
|
||||||
public Animation flag = new Animation("rallypoint");
|
public Animation flag = new Animation("rallypoint");
|
||||||
public Animation circles = new Animation("rallypoint");
|
public Animation circles = new Animation("rallypoint");
|
||||||
readonly string palette;
|
|
||||||
|
|
||||||
public RallyPoint(Actor building)
|
public RallyPoint(Actor building)
|
||||||
{
|
{
|
||||||
this.building = building;
|
this.building = building;
|
||||||
rp = building.Trait<RA.RallyPoint>();
|
rp = building.Trait<RA.RallyPoint>();
|
||||||
palette = building.Trait<RenderSimple>().Palette(building.Owner);
|
|
||||||
flag.PlayRepeating("flag");
|
flag.PlayRepeating("flag");
|
||||||
circles.Play("circles");
|
circles.Play("circles");
|
||||||
}
|
}
|
||||||
@@ -51,9 +48,12 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
|
|
||||||
public IEnumerable<Renderable> Render()
|
public IEnumerable<Renderable> Render()
|
||||||
{
|
{
|
||||||
if (building.IsInWorld && building.Owner == building.World.LocalPlayer && building.World.Selection.Actors.Contains(building))
|
if (building.IsInWorld && building.Owner == building.World.LocalPlayer
|
||||||
|
&& building.World.Selection.Actors.Contains(building))
|
||||||
{
|
{
|
||||||
var pos = Traits.Util.CenterOfCell(rp.rallyPoint);
|
var pos = Traits.Util.CenterOfCell(rp.rallyPoint);
|
||||||
|
var palette = building.Trait<RenderSimple>().Palette(building.Owner);
|
||||||
|
|
||||||
yield return new Renderable(circles.Image,
|
yield return new Renderable(circles.Image,
|
||||||
pos - .5f * circles.Image.size,
|
pos - .5f * circles.Image.size,
|
||||||
palette, (int)pos.Y);
|
palette, (int)pos.Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user