Add ITransformActorInitModifier.
Remove hardcoded Cargo reference from Transform.
This commit is contained in:
@@ -75,7 +75,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyCreated, INotifyKilled,
|
||||
INotifyOwnerChanged, INotifyAddedToWorld, ITick, INotifySold, INotifyActorDisposing, IIssueDeployOrder
|
||||
INotifyOwnerChanged, INotifyAddedToWorld, ITick, INotifySold, INotifyActorDisposing, IIssueDeployOrder,
|
||||
ITransformActorInitModifier
|
||||
{
|
||||
public readonly CargoInfo Info;
|
||||
readonly Actor self;
|
||||
@@ -469,6 +470,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
CurrentAdjacentCells = GetAdjacentCells();
|
||||
}
|
||||
}
|
||||
|
||||
void ITransformActorInitModifier.ModifyTransformActorInit(Actor self, TypeDictionary init)
|
||||
{
|
||||
init.Add(new RuntimeCargoInit(Passengers.ToArray()));
|
||||
}
|
||||
}
|
||||
|
||||
public class RuntimeCargoInit : IActorInit<Actor[]>, ISuppressInitExport
|
||||
|
||||
Reference in New Issue
Block a user