add me (jongleur1983) to AUTHORS

#14558: MovingToRefinery takes actor instead of CPos

DeliveryOffset (previously added by the harvester) is now taken into account by the AutoCarryable
fix whitespaces
This commit is contained in:
Unknown
2017-12-24 11:04:54 +01:00
committed by abcdefg30
parent 73bd80ebc5
commit 4be593123d
8 changed files with 16 additions and 8 deletions

View File

@@ -109,6 +109,7 @@ Also thanks to:
* Paul Dovydaitis (pdovy)
* Pavlos Touboulidis (pav)
* Pedro Ferreira Ramos (bateramos)
* Peter Amrehn (jongleur1983)
* Pizzaoverhead
* Pi Delport (pjdelport)
* Psydev

View File

@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Activities
{
var notify = self.TraitsImplementing<INotifyHarvesterAction>();
foreach (var n in notify)
n.MovingToRefinery(self, proc.Location + iao.DeliveryOffset, this);
n.MovingToRefinery(self, proc, this);
return ActivityUtils.SequenceActivities(movement.MoveTo(proc.Location + iao.DeliveryOffset, 0), this);
}

View File

@@ -39,7 +39,13 @@ namespace OpenRA.Mods.Common.Traits
public WDist MinimumDistance { get { return info.MinDistance; } }
void INotifyHarvesterAction.MovingToResources(Actor self, CPos targetCell, Activity next) { RequestTransport(self, targetCell, next); }
void INotifyHarvesterAction.MovingToRefinery(Actor self, CPos targetCell, Activity next) { RequestTransport(self, targetCell, next); }
void INotifyHarvesterAction.MovingToRefinery(Actor self, Actor refineryActor, Activity next)
{
var iao = refineryActor.Trait<IAcceptResources>();
RequestTransport(self, refineryActor.Location + iao.DeliveryOffset, next);
}
void INotifyHarvesterAction.MovementCancelled(Actor self) { MovementCancelled(self); }
// We do not handle Harvested notification

View File

@@ -201,7 +201,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyHarvesterAction.MovingToResources(Actor self, CPos targetCell, Activity next) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, CPos targetCell, Activity next) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, Actor refineryActor, Activity next) { }
void INotifyHarvesterAction.MovementCancelled(Actor self) { }

View File

@@ -413,8 +413,9 @@ namespace OpenRA.Mods.Common.Traits
var deliver = new DeliverResources(self);
self.QueueActivity(deliver);
foreach (var n in notify)
n.MovingToRefinery(self, order.Target.Actor.Location, deliver);
if (order.Target.Type == TargetType.Actor)
foreach (var n in notify)
n.MovingToRefinery(self, order.Target.Actor, deliver);
}
else if (order.OrderString == "Stop" || order.OrderString == "Move")
{

View File

@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
void INotifyHarvesterAction.MovingToResources(Actor self, CPos targetCell, Activity next) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, CPos targetCell, Activity next) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, Actor refineryActor, Activity next) { }
void INotifyHarvesterAction.MovementCancelled(Actor self) { }
}
}

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
public void MovingToResources(Actor self, CPos targetCell, Activity next) { }
public void MovingToRefinery(Actor self, CPos targetCell, Activity next) { }
public void MovingToRefinery(Actor self, Actor targetRefinery, Activity next) { }
public void MovementCancelled(Actor self) { }
public void Docked() { }
public void Undocked() { }

View File

@@ -152,7 +152,7 @@ namespace OpenRA.Mods.Common.Traits
public interface INotifyHarvesterAction
{
void MovingToResources(Actor self, CPos targetCell, Activity next);
void MovingToRefinery(Actor self, CPos targetCell, Activity next);
void MovingToRefinery(Actor self, Actor refineryActor, Activity next);
void MovementCancelled(Actor self);
void Harvested(Actor self, ResourceType resource);
void Docked();