Add roles to Ghost Warp Menu (#7546)

This commit is contained in:
Júlio César Ueti
2022-04-15 18:41:27 -03:00
committed by GitHub
parent 4fa8a2df5a
commit 7656290831
3 changed files with 14 additions and 7 deletions

View File

@@ -253,7 +253,12 @@ namespace Content.Server.Ghost
{
if (player.AttachedEntity is {Valid: true} attached)
{
players.Add(attached, EntityManager.GetComponent<MetaDataComponent>(attached).EntityName);
TryComp<MindComponent>(attached, out var mind);
string playerInfo = $"{EntityManager.GetComponent<MetaDataComponent>(attached).EntityName} ({mind?.Mind?.CurrentJob?.Name ?? "Unknown"})";
if (TryComp<MobStateComponent>(attached, out var state) && !state.IsDead())
players.Add(attached, playerInfo);
}
}