Servers can disable the disguise feature. Closes #568

This commit is contained in:
Joonas Rikkonen
2018-08-14 16:06:23 +03:00
parent 1e02d7406d
commit 4866a89253
5 changed files with 29 additions and 2 deletions
@@ -144,6 +144,10 @@ namespace Barotrauma
{
get
{
if (GameMain.Server != null && !GameMain.Server.AllowDisguises) return Name;
#if CLIENT
if (GameMain.Client != null && !GameMain.Client.AllowDisguises) return Name;
#endif
return info != null && !string.IsNullOrWhiteSpace(info.Name) ? info.Name + (info.DisplayName != info.Name ? " (as " + info.DisplayName + ")" : "") : SpeciesName;
}
}
@@ -17,11 +17,16 @@ namespace Barotrauma
get
{
string disguiseName = "?";
if (Character == null || !Character.HideFace)
if (Character == null || !Character.HideFace || (GameMain.Server != null && !GameMain.Server.AllowDisguises))
{
return Name;
}
#if CLIENT
if (GameMain.Client != null && !GameMain.Client.AllowDisguises)
{
return Name;
}
#endif
if (Character.Inventory != null)
{
int cardSlotIndex = Character.Inventory.FindLimbSlot(InvSlotType.Card);