get rid of Sellable.Selling state
This commit is contained in:
@@ -36,10 +36,6 @@ namespace OpenRA.Mods.RA.Activities
|
||||
if (capturable != null && capturable.CaptureInProgress && capturable.Captor.Owner.Stances[self.Owner] == Stance.Ally)
|
||||
return NextActivity;
|
||||
|
||||
var sellable = target.TraitOrDefault<Sellable>();
|
||||
if (sellable != null && sellable.Selling)
|
||||
return NextActivity;
|
||||
|
||||
if (!target.Trait<Capturable>().BeginCapture(target, self))
|
||||
return NextActivity;
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public class Sellable : IResolveOrder
|
||||
{
|
||||
[Sync] public bool Selling = false;
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "Sell" && !Selling)
|
||||
if (order.OrderString == "Sell")
|
||||
{
|
||||
var capturing = self.TraitOrDefault<Capturable>();
|
||||
if (capturing != null && capturing.CaptureInProgress)
|
||||
@@ -35,8 +33,6 @@ namespace OpenRA.Mods.RA
|
||||
if (!self.Trait<Building>().Lock())
|
||||
return;
|
||||
|
||||
Selling = true;
|
||||
|
||||
foreach( var ns in self.TraitsImplementing<INotifySold>() )
|
||||
ns.Selling( self );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user