Skip to content

Commit

Permalink
Update Mirage Tank logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cookgreen committed Sep 16, 2019
1 parent ff1ce23 commit ce8de3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
28 changes: 7 additions & 21 deletions OpenRA.Mods.YR/Traits/Variety.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,13 @@ public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnum
}

if (Varied && IsVisible(self, self.World.RenderPlayer))
{
if (!string.IsNullOrEmpty(info.Actor))
{
if (varietiedActor == null || !varietiedActor.IsInWorld)
{
return createActorAndRender(self.World, info.Actor, wr);
}
else
{
return varietiedActor.Render(wr);
}
}
else
{
var palette = string.IsNullOrEmpty(Info.Palette) ? null : Info.IsPlayerPalette ? wr.Palette(Info.Palette + self.Owner.InternalName) : wr.Palette(Info.Palette);
if (palette == null)
return r;
else
return r.Select(a => a.IsDecoration ? a : a.WithPalette(palette));
}
}
{
var palette = string.IsNullOrEmpty(Info.Palette) ? null : Info.IsPlayerPalette ? wr.Palette(Info.Palette + self.Owner.InternalName) : wr.Palette(Info.Palette);
if (palette == null)
return r;
else
return r.Select(a => a.IsDecoration ? a : a.WithPalette(palette));
}
else
{
if (!string.IsNullOrEmpty(info.Actor))
Expand Down
2 changes: 1 addition & 1 deletion mods/yr/rules/allied-vehicles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ mgtk:
Bunkerable:
Variety:
Actor: tree28
UnvarietyOn: Move
IsPlayerPalette: true
VarietyCondition: varing
Targetable:
RequiresCondition: !varing
Expand Down

0 comments on commit ce8de3c

Please sign in to comment.