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

@@ -23,7 +23,7 @@ namespace Content.Server.Botany.Components
{
for (var i = 0; i < 2; i++)
{
var plank = IoCManager.Resolve<IEntityManager>().SpawnEntity("MaterialWoodPlank1", Owner.Transform.Coordinates);
var plank = IoCManager.Resolve<IEntityManager>().SpawnEntity("MaterialWoodPlank1", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
plank.RandomOffset(0.25f);
}

View File

@@ -248,7 +248,7 @@ namespace Content.Server.Botany.Components
_updateSpriteAfterUpdate = true;
}
var environment = EntitySystem.Get<AtmosphereSystem>().GetTileMixture(Owner.Transform.Coordinates, true) ??
var environment = EntitySystem.Get<AtmosphereSystem>().GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates, true) ??
GasMixture.SpaceGas;
if (Seed.ConsumeGasses.Count > 0)
@@ -361,7 +361,7 @@ namespace Content.Server.Botany.Components
}
else if (Age < 0) // Revert back to seed packet!
{
Seed.SpawnSeedPacket(Owner.Transform.Coordinates);
Seed.SpawnSeedPacket(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
RemovePlant();
ForceUpdate = true;
Update();
@@ -453,7 +453,7 @@ namespace Content.Server.Botany.Components
if (Seed == null || !Harvest)
return;
Seed.AutoHarvest(Owner.Transform.Coordinates);
Seed.AutoHarvest(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
AfterHarvest();
}
@@ -783,7 +783,7 @@ namespace Content.Server.Botany.Components
return false;
}
var seed = Seed.SpawnSeedPacket(user.Transform.Coordinates);
var seed = Seed.SpawnSeedPacket(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates);
seed.RandomOffset(0.25f);
user.PopupMessageCursor(Loc.GetString("plant-holder-component-take-sample-message",
("seedName", Seed.DisplayName)));

View File

@@ -37,7 +37,7 @@ namespace Content.Server.Botany.Components
for (var i = 0; i < random; i++)
{
produce.Seed.SpawnSeedPacket(Owner.Transform.Coordinates, IoCManager.Resolve<IEntityManager>());
produce.Seed.SpawnSeedPacket(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates, IoCManager.Resolve<IEntityManager>());
}
return true;

View File

@@ -300,7 +300,7 @@ namespace Content.Server.Botany
}
user.PopupMessageCursor(Loc.GetString("botany-harvest-success-message", ("name", DisplayName)));
return GenerateProduct(user.Transform.Coordinates, yieldMod);
return GenerateProduct(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates, yieldMod);
}
public IEnumerable<IEntity> GenerateProduct(EntityCoordinates position, int yieldMod = 1)