Pointing coordinate fixes.
This commit is contained in:
@@ -89,6 +89,7 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
|
||||
public bool TryPoint(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||
{
|
||||
var mapCoords = coords.ToMap(EntityManager);
|
||||
var player = (session as IPlayerSession)?.ContentData()?.Mind?.CurrentEntity;
|
||||
if (player == null)
|
||||
{
|
||||
@@ -115,14 +116,14 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
|
||||
if (_actionBlockerSystem.CanChangeDirection(player))
|
||||
{
|
||||
var diff = coords.ToMapPos(EntityManager) - player.Transform.MapPosition.Position;
|
||||
var diff = mapCoords.Position - player.Transform.MapPosition.Position;
|
||||
if (diff.LengthSquared > 0.01f)
|
||||
{
|
||||
player.Transform.LocalRotation = new Angle(diff);
|
||||
}
|
||||
}
|
||||
|
||||
var arrow = EntityManager.SpawnEntity("pointingarrow", coords);
|
||||
var arrow = EntityManager.SpawnEntity("pointingarrow", mapCoords);
|
||||
|
||||
var layer = (int) VisibilityFlags.Normal;
|
||||
if (player.TryGetComponent(out VisibilityComponent? playerVisibility))
|
||||
@@ -160,8 +161,14 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
}
|
||||
else
|
||||
{
|
||||
var tileRef = _mapManager.GetGrid(coords.GetGridId(EntityManager)).GetTileRef(coords);
|
||||
var tileDef = _tileDefinitionManager[tileRef.Tile.TypeId];
|
||||
TileRef? tileRef = null;
|
||||
|
||||
if (_mapManager.TryFindGridAt(mapCoords, out var grid))
|
||||
{
|
||||
tileRef = grid.GetTileRef(grid.WorldToTile(mapCoords.Position));
|
||||
}
|
||||
|
||||
var tileDef = _tileDefinitionManager[tileRef?.Tile.TypeId ?? 0];
|
||||
|
||||
selfMessage = Loc.GetString("pointing-system-point-at-tile", ("tileName", tileDef.DisplayName));
|
||||
|
||||
|
||||
@@ -1690,7 +1690,7 @@ Entries:
|
||||
situations.', type: Fix}
|
||||
id: 301
|
||||
time: '2021-08-06T15:53:48.856573+00:00'
|
||||
- author: Your_Name_Here
|
||||
- author: Zumorica
|
||||
changes:
|
||||
- {message: Fixes pickup animation not showing under certain conditions., type: Fix}
|
||||
id: 302
|
||||
|
||||
4
Resources/Changelog/Parts/pointing_self.yml
Normal file
4
Resources/Changelog/Parts/pointing_self.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
author: Zumorica
|
||||
changes:
|
||||
- type: Fix # One of the following: Add, Remove, Tweak, Fix
|
||||
message: Fix pointing at an item in your inventory resulting in the pointing arrow playing a weird animation.
|
||||
4
Resources/Changelog/Parts/pointing_space.yml
Normal file
4
Resources/Changelog/Parts/pointing_space.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
author: Zumorica
|
||||
changes:
|
||||
- type: Fix # One of the following: Add, Remove, Tweak, Fix
|
||||
message: Fix bug where you couldn't point at space.
|
||||
Reference in New Issue
Block a user