]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Use GetHashCode for client construction (#21857)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 23 Nov 2023 13:19:30 +0000 (00:19 +1100)
committerGitHub <noreply@github.com>
Thu, 23 Nov 2023 13:19:30 +0000 (00:19 +1100)
Content.Client/Construction/ConstructionSystem.cs

index 2ca0f3d706d0d3f053a9697815b4d9356c4474fe..d0a14860f113370f6a8c50ca8ffbcab0a1473b1f 100644 (file)
@@ -198,7 +198,7 @@ namespace Content.Client.Construction
             var comp = EntityManager.GetComponent<ConstructionGhostComponent>(ghost.Value);
             comp.Prototype = prototype;
             EntityManager.GetComponent<TransformComponent>(ghost.Value).LocalRotation = dir.ToAngle();
-            _ghosts.Add(ghost.Value.Id, ghost.Value);
+            _ghosts.Add(ghost.GetHashCode(), ghost.Value);
             var sprite = EntityManager.GetComponent<SpriteComponent>(ghost.Value);
             sprite.Color = new Color(48, 255, 48, 128);
 
@@ -265,7 +265,7 @@ namespace Content.Client.Construction
             }
 
             var transform = EntityManager.GetComponent<TransformComponent>(ghostId);
-            var msg = new TryStartStructureConstructionMessage(GetNetCoordinates(transform.Coordinates), ghostComp.Prototype.ID, transform.LocalRotation, ghostId.Id);
+            var msg = new TryStartStructureConstructionMessage(GetNetCoordinates(transform.Coordinates), ghostComp.Prototype.ID, transform.LocalRotation, ghostId.GetHashCode());
             RaiseNetworkEvent(msg);
         }