* Revert "Fix chat bubbles (#25643)" This reverts commit23d2c4d924. * Revert "Fixes obsolete Transform warnings in Content. (#25256)" This reverts commitf284b43ff6.
This commit is contained in:
@@ -17,16 +17,15 @@ namespace Content.Shared.Construction.Conditions
|
||||
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
|
||||
{
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
var xfmSystem = entManager.System<SharedTransformSystem>();
|
||||
|
||||
// get blueprint and user position
|
||||
var userWorldPosition = xfmSystem.GetWorldPosition(user);
|
||||
var userWorldPosition = entManager.GetComponent<TransformComponent>(user).WorldPosition;
|
||||
var objWorldPosition = location.ToMap(entManager).Position;
|
||||
|
||||
// find direction from user to blueprint
|
||||
var userToObject = (objWorldPosition - userWorldPosition);
|
||||
// get direction of the grid being placed on as an offset.
|
||||
var gridRotation = xfmSystem.GetWorldRotation(location.EntityId);
|
||||
var gridRotation = entManager.GetComponent<TransformComponent>(location.EntityId).WorldRotation;
|
||||
var directionWithOffset = gridRotation.RotateVec(direction.ToVec());
|
||||
|
||||
// dot product will be positive if user direction and blueprint are co-directed
|
||||
|
||||
Reference in New Issue
Block a user