mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Fix mapload positions (#3510)
This commit is contained in:
@@ -647,7 +647,6 @@ public sealed class MapLoaderSystem : EntitySystem
|
||||
private void StartupEntities(MapData data)
|
||||
{
|
||||
_stopwatch.Restart();
|
||||
DebugTools.Assert(data.Entities.Count == data.Entities.Count);
|
||||
var metaQuery = GetEntityQuery<MetaDataComponent>();
|
||||
var rootEntity = data.Entities[0];
|
||||
var mapQuery = GetEntityQuery<MapComponent>();
|
||||
@@ -667,22 +666,16 @@ public sealed class MapLoaderSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
var isRoot = true;
|
||||
|
||||
for (var i = 1; i < data.Entities.Count; i++)
|
||||
{
|
||||
var entity = data.Entities[i];
|
||||
|
||||
if (isRoot && xformQuery.TryGetComponent(entity, out var xform) && IsRoot(xform, mapQuery))
|
||||
if (xformQuery.TryGetComponent(entity, out var xform) && IsRoot(xform, mapQuery))
|
||||
{
|
||||
// Don't want to trigger events
|
||||
xform._localPosition = data.Options.TransformMatrix.Transform(xform.LocalPosition);
|
||||
xform._localRotation += data.Options.Rotation;
|
||||
}
|
||||
else
|
||||
{
|
||||
isRoot = false;
|
||||
}
|
||||
|
||||
StartupEntity(entity, metaQuery.GetComponent(entity), data);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Robust.Shared.GameObjects
|
||||
[ViewVariables]
|
||||
internal BroadphaseData? Broadphase;
|
||||
|
||||
internal bool MatricesDirty = false;
|
||||
internal bool MatricesDirty = true;
|
||||
private Matrix3 _localMatrix = Matrix3.Identity;
|
||||
private Matrix3 _invLocalMatrix = Matrix3.Identity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user