TabletopSystem uses EntityUid

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 12:38:05 +01:00
parent c00cdbff90
commit 11c63112d1
4 changed files with 39 additions and 32 deletions

View File

@@ -25,7 +25,7 @@ namespace Content.Server.Tabletop
/// </summary>
private void OnTabletopMove(TabletopMoveEvent msg, EntitySessionEventArgs args)
{
if (args.SenderSession as IPlayerSession is not { AttachedEntity: { } playerEntity } playerSession)
if (args.SenderSession as IPlayerSession is not { AttachedEntityUid: { } playerEntity } playerSession)
return;
if (!EntityManager.TryGetComponent(msg.TableUid, out TabletopGameComponent? tabletop) || tabletop.Session is not {} session)
@@ -36,10 +36,10 @@ namespace Content.Server.Tabletop
return;
// Return if can not see table or stunned/no hands
if (!EntityManager.TryGetEntity(msg.TableUid, out var table))
if (!EntityManager.EntityExists(msg.TableUid))
return;
if (!CanSeeTable(playerEntity, table) || StunnedOrNoHands(playerEntity))
if (!CanSeeTable(playerEntity, msg.TableUid) || StunnedOrNoHands(playerEntity))
return;
// Check if moved entity exists and has tabletop draggable component