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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user