Replace xform.WorldPosition with xformSystem method for Setting/Getting (#30029)

* GET WORLD POSITON, ROTATION

* Missing parentheses

* ui system depndency

* the issue

* Unused

* Let the function do the transform

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
Plykiya
2024-08-06 04:02:01 -07:00
committed by GitHub
parent 7b3ff00129
commit a87efd7d01
35 changed files with 89 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Content.Server.Worldgen.Components;
using JetBrains.Annotations;
@@ -12,6 +12,7 @@ namespace Content.Server.Worldgen.Systems;
public abstract class BaseWorldSystem : EntitySystem
{
[Dependency] private readonly WorldControllerSystem _worldController = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
/// <summary>
/// Gets a chunk's coordinates in chunk space as an integer value.
@@ -25,7 +26,7 @@ public abstract class BaseWorldSystem : EntitySystem
if (!Resolve(ent, ref xform))
throw new Exception("Failed to resolve transform, somehow.");
return WorldGen.WorldToChunkCoords(xform.WorldPosition).Floored();
return WorldGen.WorldToChunkCoords(_transformSystem.GetWorldPosition(xform)).Floored();
}
/// <summary>
@@ -40,7 +41,7 @@ public abstract class BaseWorldSystem : EntitySystem
if (!Resolve(ent, ref xform))
throw new Exception("Failed to resolve transform, somehow.");
return WorldGen.WorldToChunkCoords(xform.WorldPosition);
return WorldGen.WorldToChunkCoords(_transformSystem.GetWorldPosition(xform));
}
/// <summary>