Try fix click sorting & other misc changes. (#15686)

This commit is contained in:
Leon Friedrich
2023-04-23 19:44:27 +12:00
committed by GitHub
parent a4297aef1a
commit 3116621501
4 changed files with 5 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ namespace Content.Client.Clickable
renderOrder = sprite.RenderOrder;
var (spritePos, spriteRot) = transform.GetWorldPositionRotation(xformQuery);
var spriteBB = sprite.CalculateRotatedBoundingBox(spritePos, spriteRot, eye.Rotation);
bottom = spriteBB.CalcBoundingBox().Bottom;
bottom = Matrix3.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;
var invSpriteMatrix = Matrix3.Invert(sprite.GetLocalMatrix());

View File

@@ -136,7 +136,7 @@ namespace Content.Client.Gameplay
return cmp;
}
cmp = y.bottom.CompareTo(x.bottom);
cmp = -y.bottom.CompareTo(x.bottom);
if (cmp != 0)
{

View File

@@ -118,7 +118,7 @@ public sealed class ExplosionCommand : IConsoleCommand
return;
}
}
else
else if (!protoMan.TryIndex(ExplosionSystem.DefaultExplosionPrototypeId, out type))
{
// no prototype was specified, so lets default to whichever one was defined first
type = protoMan.EnumeratePrototypes<ExplosionPrototype>().FirstOrDefault();

View File

@@ -345,11 +345,10 @@ public sealed class StationSystem : EntitySystem
/// <returns>The initialized station.</returns>
public EntityUid InitializeNewStation(StationConfig? stationConfig, IEnumerable<EntityUid>? gridIds, string? name = null)
{
var station = Spawn(null, new MapCoordinates(0, 0, _gameTicker.DefaultMap));
var station = Spawn(null, MapCoordinates.Nullspace);
// TODO SERIALIZATION The station data needs to be saveable somehow, but when a map gets saved, this entity
// won't be included because its in null-space. Also, what happens to shuttles on other maps?
_transform.DetachParentToNull(station, Transform(station));
var data = AddComp<StationDataComponent>(station);
var metaData = MetaData(station);