reset RallyPoint Location after capture. resolves #9163.

This commit is contained in:
Michael Rätzel
2015-10-31 20:31:08 +01:00
parent ef1e217a2a
commit c5029e270d

View File

@@ -38,10 +38,15 @@ namespace OpenRA.Mods.Common.Traits
public RallyPointInfo Info; public RallyPointInfo Info;
public string PaletteName { get; private set; } public string PaletteName { get; private set; }
public void ResetLocation(Actor self)
{
Location = self.Location + Info.Offset;
}
public RallyPoint(Actor self, RallyPointInfo info) public RallyPoint(Actor self, RallyPointInfo info)
{ {
Info = info; Info = info;
Location = self.Location + info.Offset; ResetLocation(self);
PaletteName = info.IsPlayerPalette ? info.Palette + self.Owner.InternalName : info.Palette; PaletteName = info.IsPlayerPalette ? info.Palette + self.Owner.InternalName : info.Palette;
self.World.Add(new RallyPointIndicator(self, this)); self.World.Add(new RallyPointIndicator(self, this));
} }
@@ -50,6 +55,8 @@ namespace OpenRA.Mods.Common.Traits
{ {
if (Info.IsPlayerPalette) if (Info.IsPlayerPalette)
PaletteName = Info.Palette + newOwner.InternalName; PaletteName = Info.Palette + newOwner.InternalName;
ResetLocation(self);
} }
public IEnumerable<IOrderTargeter> Orders public IEnumerable<IOrderTargeter> Orders