]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix for items dropped being rotated to world north (#26662)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Wed, 3 Apr 2024 05:31:57 +0000 (22:31 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Apr 2024 05:31:57 +0000 (16:31 +1100)
* Fix rotation of dropped items

* combined world position rotation function for dumpable

* scuffed implementation?

* less scuffed?

* even less scuffed... I guess

* capital D

---------

Co-authored-by: Plykiya <plykiya@protonmail.com>
Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs
Content.Shared/Storage/EntitySystems/DumpableSystem.cs

index e071cdc69380c4f58e589a79ab4f2c5b827d3016..7b169b5d0a6f299e0ae45278fa6d23c8a4ea764d 100644 (file)
@@ -134,8 +134,10 @@ public abstract partial class SharedHandsSystem
             return true;
         }
 
+        var (itemPos, itemRot) = TransformSystem.GetWorldPositionRotation(entity);
+        var origin = new MapCoordinates(itemPos, itemXform.MapID);
         var target = targetDropLocation.Value.ToMap(EntityManager, TransformSystem);
-        TransformSystem.SetWorldPosition(itemXform, GetFinalDropCoordinates(uid, userXform.MapPosition, target));
+        TransformSystem.SetWorldPositionRotation(entity, GetFinalDropCoordinates(uid, origin, target), itemRot);
         return true;
     }
 
index 8a8b636a679615676fb89ac729a0aa6702894cac..91acde47e19daddbc7ee72eae6d88625e58e4480 100644 (file)
@@ -159,11 +159,11 @@ public sealed class DumpableSystem : EntitySystem
         {
             dumped = true;
 
-            var targetPos = _transformSystem.GetWorldPosition(args.Args.Target.Value);
+            var (targetPos, targetRot) = _transformSystem.GetWorldPositionRotation(args.Args.Target.Value);
 
             foreach (var entity in dumpQueue)
             {
-                _transformSystem.SetWorldPosition(entity, targetPos + _random.NextVector2Box() / 4);
+                _transformSystem.SetWorldPositionRotation(entity, targetPos + _random.NextVector2Box() / 4, targetRot);
             }
         }
         else