Remove some bogus duplication in Sell (caused the double-sell bug).
This commit is contained in:
@@ -37,7 +37,9 @@ namespace OpenRA.Mods.RA.Activities
|
||||
started = true;
|
||||
if (Reversed)
|
||||
{
|
||||
foreach (var s in self.Info.Traits.Get<BuildingInfo>().SellSounds)
|
||||
var bi = self.Info.Traits.GetOrDefault<BuildingInfo>();
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -112,16 +112,5 @@ namespace OpenRA.Mods.RA.Render
|
||||
else if (e.DamageState < DamageState.Heavy)
|
||||
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; });
|
||||
}
|
||||
|
||||
public override void Selling( Actor self )
|
||||
public void Selling(Actor self)
|
||||
{
|
||||
self.Trait<RenderSimple>().anims.Remove("roof");
|
||||
base.Selling(self);
|
||||
}
|
||||
}
|
||||
|
||||
public void Sold(Actor self) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user