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)
|
public bool TryPoint(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||||
{
|
{
|
||||||
|
var mapCoords = coords.ToMap(EntityManager);
|
||||||
var player = (session as IPlayerSession)?.ContentData()?.Mind?.CurrentEntity;
|
var player = (session as IPlayerSession)?.ContentData()?.Mind?.CurrentEntity;
|
||||||
if (player == null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
@@ -115,14 +116,14 @@ namespace Content.Server.Pointing.EntitySystems
|
|||||||
|
|
||||||
if (_actionBlockerSystem.CanChangeDirection(player))
|
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)
|
if (diff.LengthSquared > 0.01f)
|
||||||
{
|
{
|
||||||
player.Transform.LocalRotation = new Angle(diff);
|
player.Transform.LocalRotation = new Angle(diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var arrow = EntityManager.SpawnEntity("pointingarrow", coords);
|
var arrow = EntityManager.SpawnEntity("pointingarrow", mapCoords);
|
||||||
|
|
||||||
var layer = (int) VisibilityFlags.Normal;
|
var layer = (int) VisibilityFlags.Normal;
|
||||||
if (player.TryGetComponent(out VisibilityComponent? playerVisibility))
|
if (player.TryGetComponent(out VisibilityComponent? playerVisibility))
|
||||||
@@ -160,8 +161,14 @@ namespace Content.Server.Pointing.EntitySystems
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var tileRef = _mapManager.GetGrid(coords.GetGridId(EntityManager)).GetTileRef(coords);
|
TileRef? tileRef = null;
|
||||||
var tileDef = _tileDefinitionManager[tileRef.Tile.TypeId];
|
|
||||||
|
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));
|
selfMessage = Loc.GetString("pointing-system-point-at-tile", ("tileName", tileDef.DisplayName));
|
||||||
|
|
||||||
|
|||||||
@@ -1690,7 +1690,7 @@ Entries:
|
|||||||
situations.', type: Fix}
|
situations.', type: Fix}
|
||||||
id: 301
|
id: 301
|
||||||
time: '2021-08-06T15:53:48.856573+00:00'
|
time: '2021-08-06T15:53:48.856573+00:00'
|
||||||
- author: Your_Name_Here
|
- author: Zumorica
|
||||||
changes:
|
changes:
|
||||||
- {message: Fixes pickup animation not showing under certain conditions., type: Fix}
|
- {message: Fixes pickup animation not showing under certain conditions., type: Fix}
|
||||||
id: 302
|
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