fix #688
This commit is contained in:
@@ -63,13 +63,17 @@ namespace OpenRA.Mods.RA.Buildings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.World.AddFrameEndTask(w => w.Add(new RepairIndicator(self)));
|
self.World.AddFrameEndTask(
|
||||||
|
w => w.Add(new RepairIndicator(self, Info.RepairInterval / 2)));
|
||||||
|
|
||||||
self.InflictDamage(self, -hpToRepair, null);
|
self.InflictDamage(self, -hpToRepair, null);
|
||||||
|
|
||||||
if (Health.DamageState == DamageState.Undamaged)
|
if (Health.DamageState == DamageState.Undamaged)
|
||||||
{
|
{
|
||||||
isRepairing = false;
|
isRepairing = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
remainingTicks = Info.RepairInterval;
|
remainingTicks = Info.RepairInterval;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
Actor a;
|
Actor a;
|
||||||
Animation anim = new Animation("select");
|
Animation anim = new Animation("select");
|
||||||
|
|
||||||
public RepairIndicator(Actor a)
|
public RepairIndicator(Actor a, int frames)
|
||||||
{
|
{
|
||||||
this.a = a; anim.PlayRepeating("repair");
|
this.a = a; anim.PlayRepeating("repair");
|
||||||
framesLeft = a.Info.Traits.Get<RepairableBuildingInfo>().RepairInterval / 2;
|
framesLeft = frames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick( World world )
|
public void Tick( World world )
|
||||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
|
|
||||||
public IEnumerable<Renderable> Render()
|
public IEnumerable<Renderable> Render()
|
||||||
{
|
{
|
||||||
if (a.IsInWorld)
|
if (!a.Destroyed)
|
||||||
yield return new Renderable(anim.Image,
|
yield return new Renderable(anim.Image,
|
||||||
a.CenterLocation - .5f * anim.Image.size, "chrome", (int)a.CenterLocation.Y);
|
a.CenterLocation - .5f * anim.Image.size, "chrome", (int)a.CenterLocation.Y);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user