fix examine bug (#5205)
This commit is contained in:
@@ -73,19 +73,19 @@ namespace Content.Client.Examine
|
|||||||
|
|
||||||
private bool HandleExamine(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
private bool HandleExamine(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||||
{
|
{
|
||||||
if (!uid.IsValid() || !EntityManager.TryGetEntity(uid, out _examinedEntity))
|
if (!uid.IsValid() || !EntityManager.TryGetEntity(uid, out var entity))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
|
_playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
|
||||||
|
|
||||||
if (_playerEntity == null || !CanExamine(_playerEntity, _examinedEntity))
|
if (_playerEntity == null || !CanExamine(_playerEntity, entity))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DoExamine(_examinedEntity);
|
DoExamine(entity);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +107,9 @@ namespace Content.Client.Examine
|
|||||||
// Close any examine tooltip that might already be opened
|
// Close any examine tooltip that might already be opened
|
||||||
CloseTooltip();
|
CloseTooltip();
|
||||||
|
|
||||||
|
// cache entity for Update function
|
||||||
|
_examinedEntity = entity;
|
||||||
|
|
||||||
const float minWidth = 300;
|
const float minWidth = 300;
|
||||||
var popupPos = _userInterfaceManager.MousePositionScaled;
|
var popupPos = _userInterfaceManager.MousePositionScaled;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user