Inline Transform
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user