TabletopSystem uses EntityUid
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.Tabletop
|
||||
|
||||
foreach (var gamer in EntityManager.EntityQuery<TabletopGamerComponent>())
|
||||
{
|
||||
if (!EntityManager.TryGetEntity(gamer.Tabletop, out var table))
|
||||
if (!EntityManager.EntityExists(gamer.Tabletop))
|
||||
continue;
|
||||
|
||||
if (!gamer.Owner.TryGetComponent(out ActorComponent? actor))
|
||||
@@ -103,11 +103,13 @@ namespace Content.Server.Tabletop
|
||||
return;
|
||||
};
|
||||
|
||||
if (actor.PlayerSession.Status > SessionStatus.Connected || CanSeeTable(gamer.Owner, table)
|
||||
|| !StunnedOrNoHands(gamer.Owner))
|
||||
var gamerUid = gamer.OwnerUid;
|
||||
|
||||
if (actor.PlayerSession.Status > SessionStatus.Connected || CanSeeTable(gamerUid, gamer.Tabletop)
|
||||
|| !StunnedOrNoHands(gamerUid))
|
||||
continue;
|
||||
|
||||
CloseSessionFor(actor.PlayerSession, table.Uid);
|
||||
CloseSessionFor(actor.PlayerSession, gamer.Tabletop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user