Remove some bogus duplication in Sell (caused the double-sell bug).
This commit is contained in:
@@ -37,8 +37,10 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
started = true;
|
started = true;
|
||||||
if (Reversed)
|
if (Reversed)
|
||||||
{
|
{
|
||||||
foreach (var s in self.Info.Traits.Get<BuildingInfo>().SellSounds)
|
var bi = self.Info.Traits.GetOrDefault<BuildingInfo>();
|
||||||
Sound.PlayToPlayer(self.Owner, s, self.CenterLocation);
|
if (bi != null)
|
||||||
|
foreach (var s in bi.SellSounds)
|
||||||
|
Sound.PlayToPlayer(self.Owner, s, self.CenterLocation);
|
||||||
|
|
||||||
// PlayCustomAnim is required to stop a frame of the normal state after the anim completes
|
// PlayCustomAnim is required to stop a frame of the normal state after the anim completes
|
||||||
rb.PlayCustomAnimBackwards(self, "make", () => {rb.PlayCustomAnim(self, "make"); complete = true;});
|
rb.PlayCustomAnimBackwards(self, "make", () => {rb.PlayCustomAnim(self, "make"); complete = true;});
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RenderBuilding : RenderSimple, INotifyDamage, INotifySold, IRenderModifier
|
public class RenderBuilding : RenderSimple, INotifyDamage, IRenderModifier
|
||||||
{
|
{
|
||||||
readonly RenderBuildingInfo Info;
|
readonly RenderBuildingInfo Info;
|
||||||
|
|
||||||
@@ -112,16 +112,5 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
else if (e.DamageState < DamageState.Heavy)
|
else if (e.DamageState < DamageState.Heavy)
|
||||||
anim.ReplaceAnim("idle");
|
anim.ReplaceAnim("idle");
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Selling( Actor self )
|
|
||||||
{
|
|
||||||
if( Info.HasMakeAnimation )
|
|
||||||
anim.PlayBackwardsThen( "make", null );
|
|
||||||
|
|
||||||
foreach (var s in self.Info.Traits.Get<BuildingInfo>().SellSounds)
|
|
||||||
Sound.PlayToPlayer(self.Owner, s, self.CenterLocation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Sold(Actor self) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,10 +87,11 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
roof.PlayThen(NormalizeSequence(self, "build-top"), () => { isOpen = true; openExit = exit; });
|
roof.PlayThen(NormalizeSequence(self, "build-top"), () => { isOpen = true; openExit = exit; });
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Selling( Actor self )
|
public void Selling(Actor self)
|
||||||
{
|
{
|
||||||
self.Trait<RenderSimple>().anims.Remove( "roof" );
|
self.Trait<RenderSimple>().anims.Remove("roof");
|
||||||
base.Selling(self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Sold(Actor self) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user