Unstable 0.16.2.0

This commit is contained in:
Markus Isberg
2022-02-02 00:55:02 +09:00
parent b259af5911
commit 6814a11520
106 changed files with 1634 additions and 793 deletions
@@ -85,7 +85,9 @@ namespace Barotrauma.Networking
get
{
if (customTextColor != null) { return customTextColor.Value; }
return MessageColor[(int)Type];
int intType = (int)Type;
if (intType < 0 || intType >= MessageColor.Length) { return Color.White; }
return MessageColor[intType];
}
set
@@ -230,13 +232,13 @@ namespace Barotrauma.Networking
break;
case ChatMessageType.Radio:
case ChatMessageType.Order:
if (receiver != null && !receiver.IsDead)
if (receiver?.Inventory != null && !receiver.IsDead)
{
foreach (Item receiverItem in receiver.Inventory?.AllItems.Where(i => i.GetComponent<WifiComponent>()?.LinkToChat ?? false))
foreach (Item receiverItem in receiver.Inventory.AllItems.Where(i => i.GetComponent<WifiComponent>()?.LinkToChat ?? false))
{
if (!receiver.HasEquippedItem(receiverItem)) { continue; }
if (sender.Inventory == null || !receiver.HasEquippedItem(receiverItem)) { continue; }
foreach (Item senderItem in sender.Inventory?.AllItems.Where(i => i.GetComponent<WifiComponent>()?.LinkToChat ?? false))
foreach (Item senderItem in sender.Inventory.AllItems.Where(i => i.GetComponent<WifiComponent>()?.LinkToChat ?? false))
{
if (!sender.HasEquippedItem(senderItem)) { continue; }