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

@@ -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);
}
}
}