Merge branch 'master' into moRags
This commit is contained in:
@@ -105,18 +105,18 @@ namespace Barotrauma.Networking
|
||||
return ApplyDistanceEffect(listener, Sender, Text, SpeakRange);
|
||||
}
|
||||
|
||||
public static string ApplyDistanceEffect(Entity listener, Entity Sender, string text, float range)
|
||||
public static string ApplyDistanceEffect(Entity listener, Entity Sender, string text, float range, float obstructionmult = 2.0f)
|
||||
{
|
||||
if (listener.WorldPosition == Sender.WorldPosition) return text;
|
||||
|
||||
float dist = Vector2.Distance(listener.WorldPosition, Sender.WorldPosition);
|
||||
if (dist > range) return "";
|
||||
|
||||
if (Submarine.CheckVisibility(listener.SimPosition, Sender.SimPosition) != null) dist *= 2.0f;
|
||||
if (Submarine.CheckVisibility(listener.SimPosition, Sender.SimPosition) != null) dist = (dist + 100f) * obstructionmult;
|
||||
if (dist > range) return "";
|
||||
|
||||
float garbleAmount = dist / range;
|
||||
if (garbleAmount < 0.5f) return text;
|
||||
if (garbleAmount < 0.3f) return text;
|
||||
|
||||
int startIndex = Math.Max(text.IndexOf(':') + 1, 1);
|
||||
|
||||
|
||||
@@ -1848,7 +1848,7 @@ namespace Barotrauma.Networking
|
||||
case ChatMessageType.Default:
|
||||
if (!receiver.IsDead)
|
||||
{
|
||||
return ChatMessage.ApplyDistanceEffect(receiver, sender, message, ChatMessage.SpeakRange);
|
||||
return ChatMessage.ApplyDistanceEffect(receiver, sender, message, ChatMessage.SpeakRange, 3.0f);
|
||||
}
|
||||
break;
|
||||
case ChatMessageType.Radio:
|
||||
|
||||
@@ -533,7 +533,9 @@ namespace Barotrauma.Networking
|
||||
foreach (string s in shuttleSpawnPoints[i].IdCardTags)
|
||||
{
|
||||
item.AddTag(s);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(shuttleSpawnPoints[i].IdCardDesc))
|
||||
item.Description = shuttleSpawnPoints[i].IdCardDesc;
|
||||
}
|
||||
#if CLIENT
|
||||
GameMain.GameSession.CrewManager.AddCharacter(character);
|
||||
|
||||
Reference in New Issue
Block a user