Fix EndRound exception when a mind doesn't have a character name nor valid entity.

This commit is contained in:
Vera Aguilera Puerto
2022-03-05 12:42:24 +01:00
parent ab1b90c6b8
commit cd1902cdf2

View File

@@ -333,12 +333,12 @@ namespace Content.Server.GameTicking
// Finish
var antag = mind.AllRoles.Any(role => role.Antagonist);
var playerIcName = string.Empty;
var playerIcName = "Unknown";
if (mind.CharacterName != null)
playerIcName = mind.CharacterName;
else if (mind.CurrentEntity != null)
playerIcName = EntityManager.GetComponent<MetaDataComponent>(mind.CurrentEntity.Value).EntityName;
else if (mind.CurrentEntity != null && TryName(mind.CurrentEntity.Value, out var icName))
playerIcName = icName;
var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo()
{