Clean up a ton of bugs with suspicion.

This commit is contained in:
Pieter-Jan Briers
2021-01-04 09:17:44 +01:00
parent 9c2aaef73a
commit c1f53a4303
5 changed files with 47 additions and 222 deletions

View File

@@ -58,14 +58,11 @@ namespace Content.Client.UserInterface.Suspicion
return;
}
var allies = string.Join(", ",
role.Allies.Select(uid => _entityManager.GetEntity(uid).Name));
var allies = string.Join(", ", role.Allies.Select(tuple => tuple.name));
var message = role.Allies.Count switch
{
0 => Loc.GetString("You have no allies"),
1 => Loc.GetString("Your ally is {0}", allies),
var n when n > 2 => Loc.GetString("Your allies are {0}", allies),
_ => throw new ArgumentException($"Invalid number of allies: {role.Allies.Count}")
var n => Loc.GetPluralString("Your ally is {0}", "Your allies are {0}", n, allies),
};
role.Owner.PopupMessage(message);