Inline Transform
This commit is contained in:
@@ -62,7 +62,7 @@ namespace Content.Server.Spawners.Components
|
||||
}
|
||||
|
||||
if(!((!IoCManager.Resolve<IEntityManager>().EntityExists(Owner.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityLifeStage) >= EntityLifeStage.Deleted))
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(Prototypes), Owner.Transform.Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(Prototypes), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
}
|
||||
|
||||
public virtual void MapInit()
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Spawners.Components
|
||||
{
|
||||
if (RarePrototypes.Count > 0 && (RareChance == 1.0f || _robustRandom.Prob(RareChance)))
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(RarePrototypes), Owner.Transform.Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(RarePrototypes), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace Content.Server.Spawners.Components
|
||||
var x_negative = random.Prob(0.5f) ? -1 : 1;
|
||||
var y_negative = random.Prob(0.5f) ? -1 : 1;
|
||||
|
||||
var entity = IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(Prototypes), Owner.Transform.Coordinates);
|
||||
entity.Transform.LocalPosition += new Vector2(random.NextFloat() * Offset * x_negative, random.NextFloat() * Offset * y_negative);
|
||||
var entity = IoCManager.Resolve<IEntityManager>().SpawnEntity(_robustRandom.Pick(Prototypes), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).LocalPosition += new Vector2(random.NextFloat() * Offset * x_negative, random.NextFloat() * Offset * y_negative);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Content.Server.Spawners.Components
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
var entity = _robustRandom.Pick(Prototypes);
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(entity, Owner.Transform.Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(entity, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user