fix wallmount vending machine dispense direction (#38112)
fix wallmount vending machine direction
This commit is contained in:
@@ -227,14 +227,13 @@ namespace Content.Server.VendingMachines
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default spawn coordinates
|
// 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.
|
//Make sure the wallvends spawn outside of the wall.
|
||||||
|
|
||||||
if (TryComp<WallMountComponent>(uid, out var wallMountComponent))
|
if (TryComp<WallMountComponent>(uid, out var wallMountComponent))
|
||||||
{
|
{
|
||||||
|
var offset = (wallMountComponent.Direction + xform.LocalRotation - Math.PI / 2).ToVec() * WallVendEjectDistanceFromWall;
|
||||||
var offset = wallMountComponent.Direction.ToWorldVec() * WallVendEjectDistanceFromWall;
|
|
||||||
spawnCoordinates = spawnCoordinates.Offset(offset);
|
spawnCoordinates = spawnCoordinates.Offset(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user