Hotfix 0.16.7.0

This commit is contained in:
Markus Isberg
2022-02-26 02:16:41 +09:00
parent 102e089aa6
commit a83f375681
15 changed files with 62 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ namespace Barotrauma
{
private static List<ScalableFont> FontList = new List<ScalableFont>();
private static Library Lib = null;
private static object mutex = new object();
private readonly object mutex = new object();
private string filename;
private Face face;
@@ -256,10 +256,33 @@ namespace Barotrauma
}
private void DynamicRenderAtlas(GraphicsDevice gd, uint character, int texDims = 1024, uint baseChar = 0x54)
=> DynamicRenderAtlas(gd, character.ToEnumerable(), texDims, baseChar);
{
bool missingCharacterFound = false;
lock (mutex)
{
missingCharacterFound = !texCoords.ContainsKey(character);
}
if (!missingCharacterFound) { return; }
DynamicRenderAtlas(gd, character.ToEnumerable(), texDims, baseChar);
}
private void DynamicRenderAtlas(GraphicsDevice gd, string str, int texDims = 1024, uint baseChar = 0x54)
=> DynamicRenderAtlas(gd, str.Distinct().Select(c => (uint)c), texDims, baseChar);
{
bool missingCharacterFound = false;
var distinctChrs = str.Distinct().Select(c => (uint)c).ToArray();
lock (mutex)
{
foreach (var character in distinctChrs)
{
if (texCoords.ContainsKey(character)) { continue; }
missingCharacterFound = true;
break;
}
}
if (!missingCharacterFound) { return; }
DynamicRenderAtlas(gd, distinctChrs, texDims, baseChar);
}
private void DynamicRenderAtlas(GraphicsDevice gd, IEnumerable<uint> characters, int texDims = 1024, uint baseChar = 0x54)
{
@@ -268,7 +291,7 @@ namespace Barotrauma
CrossThread.RequestExecutionOnMainThread(() =>
{
DynamicRenderAtlas(gd, characters, texDims, baseChar);
});
});
return;
}

View File

@@ -1299,7 +1299,7 @@ namespace Barotrauma
private bool CreateOrder(Order order, Hull targetHull = null)
{
var sub = Character.Controlled.Submarine;
var sub = Character.Controlled?.Submarine;
if (sub == null || sub.TeamID != Character.Controlled.TeamID || sub.Info.IsWreck) { return false; }

View File

@@ -2984,6 +2984,8 @@ namespace Barotrauma.Networking
public void SetupLoadCampaign(string saveName)
{
if (clientPeer == null) { return; }
GameMain.NetLobbyScreen.CampaignSetupFrame.Visible = false;
GameMain.NetLobbyScreen.CampaignFrame.Visible = false;

View File

@@ -1743,6 +1743,7 @@ namespace Barotrauma
public void SetSpectate(bool spectate)
{
if (GameMain.Client == null) { return; }
this.spectateBox.Selected = spectate;
if (spectate)
{

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.6.1</Version>
<Version>0.16.7.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -1030,7 +1030,7 @@ namespace Barotrauma
const int maxDist = 1000;
if (level != null)
if (level != null && !level.Removed)
{
foreach (var ruin in level.Ruins)
{

View File

@@ -79,17 +79,18 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
bool sendOutput = true;
bool state = true;
for (int i = 0; i < timeSinceReceived.Length; i++)
{
if (timeSinceReceived[i] > timeFrame) { sendOutput = false; }
if (timeSinceReceived[i] > timeFrame) { state = false; }
timeSinceReceived[i] += deltaTime;
}
string signalOut = sendOutput ? output : falseOutput;
string signalOut = state ? output : falseOutput;
if (string.IsNullOrEmpty(signalOut))
{
IsActive = false;
//deactivate the component if state is false and there's no false output (will be woken up by non-zero signals in ReceiveSignal)
if (!state) { IsActive = false; }
return;
}

View File

@@ -12,17 +12,18 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
bool sendOutput = false;
bool state = false;
for (int i = 0; i < timeSinceReceived.Length; i++)
{
if (timeSinceReceived[i] <= timeFrame) { sendOutput = true; }
if (timeSinceReceived[i] <= timeFrame) { state = true; }
timeSinceReceived[i] += deltaTime;
}
string signalOut = sendOutput ? output : falseOutput;
string signalOut = state ? output : falseOutput;
if (string.IsNullOrEmpty(signalOut))
{
IsActive = false;
//deactivate the component if state is false and there's no false output (will be woken up by non-zero signals in ReceiveSignal)
if (!state) { IsActive = false; }
return;
}

View File

@@ -12,17 +12,19 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
int sendOutput = 0;
int receivedInputs = 0;
for (int i = 0; i < timeSinceReceived.Length; i++)
{
if (timeSinceReceived[i] <= timeFrame) { sendOutput += 1; }
if (timeSinceReceived[i] <= timeFrame) { receivedInputs += 1; }
timeSinceReceived[i] += deltaTime;
}
string signalOut = sendOutput == 1 ? output : falseOutput;
bool state = receivedInputs == 1;
string signalOut = state ? output : falseOutput;
if (string.IsNullOrEmpty(signalOut))
{
IsActive = false;
//deactivate the component if state is false and there's no false output (will be woken up by non-zero signals in ReceiveSignal)
if (!state) { IsActive = false; }
return;
}

View File

@@ -1,3 +1,11 @@
---------------------------------------------------------------------------------------------------------
v0.16.7.0
---------------------------------------------------------------------------------------------------------
- Fixed excessive loading times when playing in Chinese, Japanese or Korean.
- Fixed certain logic components (and/or/xor with an empty output and non-empty false output) stopping to work altogether when they stop sending a signal.
- Fixes to crashes when trying to interact with certain elements in the server lobby while getting disconnected.
---------------------------------------------------------------------------------------------------------
v0.16.6.1
---------------------------------------------------------------------------------------------------------