Inline Transform

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:20:34 +01:00
parent 69b270017b
commit a5b57c8e10
283 changed files with 742 additions and 709 deletions

View File

@@ -36,8 +36,8 @@ namespace Content.Server.Singularity.Components
Generator2 = generator2;
//generateFields
var pos1 = generator1.Owner.Transform.Coordinates;
var pos2 = generator2.Owner.Transform.Coordinates;
var pos1 = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(generator1.Owner.Uid).Coordinates;
var pos2 = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(generator2.Owner.Uid).Coordinates;
if (pos1 == pos2)
{
Dispose();
@@ -62,7 +62,7 @@ namespace Content.Server.Singularity.Components
}
containmentFieldComponent.Parent = this;
newEnt.Transform.WorldRotation = generator1.Owner.Transform.WorldRotation + dirVec.ToWorldAngle();
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(newEnt.Uid).WorldRotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(generator1.Owner.Uid).WorldRotation + dirVec.ToWorldAngle();
_fields.Add(newEnt);
currentOffset += dirVec;

View File

@@ -96,9 +96,9 @@ namespace Content.Server.Singularity.Components
{
if (_connection1?.Item1 == direction || _connection2?.Item1 == direction) continue;
var dirVec = Owner.Transform.WorldRotation.RotateVec(direction.ToVec());
var ray = new CollisionRay(Owner.Transform.WorldPosition, dirVec, (int) CollisionGroup.MobMask);
var rawRayCastResults = EntitySystem.Get<SharedPhysicsSystem>().IntersectRay(Owner.Transform.MapID, ray, 4.5f, Owner, false);
var dirVec = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).WorldRotation.RotateVec(direction.ToVec());
var ray = new CollisionRay(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).WorldPosition, dirVec, (int) CollisionGroup.MobMask);
var rawRayCastResults = EntitySystem.Get<SharedPhysicsSystem>().IntersectRay(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).MapID, ray, 4.5f, Owner, false);
var rayCastResults = rawRayCastResults as RayCastResults[] ?? rawRayCastResults.ToArray();
if(!rayCastResults.Any()) continue;

View File

@@ -97,7 +97,7 @@ namespace Content.Server.Singularity.Components
protected override void Shutdown()
{
base.Shutdown();
SoundSystem.Play(Filter.Pvs(Owner), _singularityCollapsingSound.GetSound(), Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), _singularityCollapsingSound.GetSound(), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
}
}
}

View File

@@ -22,7 +22,7 @@ namespace Content.Server.Singularity.Components
if (_power > 15)
{
var entityManager = IoCManager.Resolve<IEntityManager>();
entityManager.SpawnEntity("Singularity", Owner.Transform.Coordinates);
entityManager.SpawnEntity("Singularity", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
//dont delete ourselves, just wait to get eaten
}
}