Add support for FTL points (#12891)
This commit is contained in:
@@ -460,13 +460,22 @@ public sealed partial class ShuttleSystem
|
|||||||
|
|
||||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||||
var shuttleAABB = Comp<MapGridComponent>(component.Owner).LocalAABB;
|
var shuttleAABB = Comp<MapGridComponent>(component.Owner).LocalAABB;
|
||||||
|
Box2 targetLocalAABB;
|
||||||
|
|
||||||
// Spawn nearby.
|
// Spawn nearby.
|
||||||
// We essentially expand the Box2 of the target area until nothing else is added then we know it's valid.
|
// We essentially expand the Box2 of the target area until nothing else is added then we know it's valid.
|
||||||
// Can't just get an AABB of every grid as we may spawn very far away.
|
// Can't just get an AABB of every grid as we may spawn very far away.
|
||||||
var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery)
|
if (TryComp<MapGridComponent>(targetUid, out var targetGrid))
|
||||||
.TransformBox(Comp<MapGridComponent>(targetUid).LocalAABB).Enlarged(shuttleAABB.Size.Length);
|
{
|
||||||
|
targetLocalAABB = targetGrid.LocalAABB;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetLocalAABB = new Box2();
|
||||||
|
}
|
||||||
|
|
||||||
|
var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery)
|
||||||
|
.TransformBox(targetLocalAABB).Enlarged(shuttleAABB.Size.Length);
|
||||||
var nearbyGrids = new HashSet<EntityUid>(1) { targetUid };
|
var nearbyGrids = new HashSet<EntityUid>(1) { targetUid };
|
||||||
var iteration = 0;
|
var iteration = 0;
|
||||||
var lastCount = 1;
|
var lastCount = 1;
|
||||||
|
|||||||
8
Resources/Prototypes/Entities/Markers/shuttle.yml
Normal file
8
Resources/Prototypes/Entities/Markers/shuttle.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- type: entity
|
||||||
|
id: FTLPoint
|
||||||
|
parent: MarkerBase
|
||||||
|
name: FTL point
|
||||||
|
components:
|
||||||
|
- type: FTLDestination
|
||||||
|
- type: Sprite
|
||||||
|
state: pink
|
||||||
Reference in New Issue
Block a user