harv wont use enemy proc automatically anymore; ore goes to proc owner
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
{
|
{
|
||||||
if( isDone )
|
if( isDone )
|
||||||
{
|
{
|
||||||
self.traits.Get<Harvester>().Deliver( self );
|
self.traits.Get<Harvester>().Deliver( self, refinery );
|
||||||
return NextActivity ?? new Harvest();
|
return NextActivity ?? new Harvest();
|
||||||
}
|
}
|
||||||
else if( NextActivity != null )
|
else if( NextActivity != null )
|
||||||
@@ -42,7 +42,8 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
umt = mobile.GetMovementType(),
|
umt = mobile.GetMovementType(),
|
||||||
checkForBlocked = false,
|
checkForBlocked = false,
|
||||||
};
|
};
|
||||||
var refineries = Game.world.Actors.Where( x => x.unitInfo != null && x.unitInfo.Name == "proc" ).ToList();
|
var refineries = Game.world.Actors.Where( x => x.unitInfo != null
|
||||||
|
&& x.unitInfo.Name == "proc" && x.Owner == self.Owner ).ToList();
|
||||||
if( refinery != null )
|
if( refinery != null )
|
||||||
search.AddInitialCell( refinery.Location + refineryDeliverOffset );
|
search.AddInitialCell( refinery.Location + refineryDeliverOffset );
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ namespace OpenRa.Game.Traits
|
|||||||
else oreCarried++;
|
else oreCarried++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deliver(Actor self)
|
public void Deliver(Actor self, Actor proc)
|
||||||
{
|
{
|
||||||
self.Owner.GiveCash(oreCarried * Rules.General.GoldValue);
|
proc.Owner.GiveCash(oreCarried * Rules.General.GoldValue);
|
||||||
self.Owner.GiveCash(gemsCarried * Rules.General.GemValue);
|
proc.Owner.GiveCash(gemsCarried * Rules.General.GemValue);
|
||||||
oreCarried = 0;
|
oreCarried = 0;
|
||||||
gemsCarried = 0;
|
gemsCarried = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user