fix wallmount vending machine dispense direction (#38112)

fix wallmount vending machine direction
This commit is contained in:
slarticodefast
2025-06-07 01:08:16 +02:00
committed by GitHub
parent 3d54da58da
commit f274dc6526

View File

@@ -227,14 +227,13 @@ namespace Content.Server.VendingMachines
}
// Default spawn coordinates
var spawnCoordinates = Transform(uid).Coordinates;
var xform = Transform(uid);
var spawnCoordinates = xform.Coordinates;
//Make sure the wallvends spawn outside of the wall.
if (TryComp<WallMountComponent>(uid, out var wallMountComponent))
{
var offset = wallMountComponent.Direction.ToWorldVec() * WallVendEjectDistanceFromWall;
var offset = (wallMountComponent.Direction + xform.LocalRotation - Math.PI / 2).ToVec() * WallVendEjectDistanceFromWall;
spawnCoordinates = spawnCoordinates.Offset(offset);
}