Add TargetableOffsets to HitShape
And remove ITargetablePositions from Building. Also, added UseFootprintOffsets to replicate the old Building behavior for easier setup of TargetablePositions for buildings.
This commit is contained in:
@@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class Building : IOccupySpace, INotifySold, INotifyTransform, ISync, INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld, ITargetablePositions
|
||||
public class Building : IOccupySpace, INotifySold, INotifyTransform, ISync, INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld
|
||||
{
|
||||
public readonly BuildingInfo Info;
|
||||
public bool BuildComplete { get; private set; }
|
||||
@@ -143,6 +143,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly Actor self;
|
||||
public readonly bool SkipMakeAnimation;
|
||||
|
||||
Pair<CPos, SubCell>[] occupiedCells;
|
||||
|
||||
// Shared activity lock: undeploy, sell, capture, etc.
|
||||
[Sync] public bool Locked = true;
|
||||
|
||||
@@ -173,14 +175,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
SkipMakeAnimation = init.Contains<SkipMakeAnimsInit>();
|
||||
}
|
||||
|
||||
Pair<CPos, SubCell>[] occupiedCells;
|
||||
public IEnumerable<Pair<CPos, SubCell>> OccupiedCells() { return occupiedCells; }
|
||||
|
||||
public IEnumerable<WPos> TargetablePositions(Actor self)
|
||||
{
|
||||
return OccupiedCells().Select(c => self.World.Map.CenterOfCell(c.First));
|
||||
}
|
||||
|
||||
void INotifyCreated.Created(Actor self)
|
||||
{
|
||||
if (SkipMakeAnimation || !self.Info.HasTraitInfo<WithMakeAnimationInfo>())
|
||||
|
||||
Reference in New Issue
Block a user