Unstable 1.2.4.0

This commit is contained in:
Markus Isberg
2023-11-30 13:53:00 +02:00
parent 8a2e2ea0ae
commit fb5ea537bf
210 changed files with 4201 additions and 1283 deletions
@@ -1,11 +1,10 @@
using Barotrauma.Extensions;
using Barotrauma.Extensions;
using Barotrauma.Items.Components;
using Barotrauma.Networking;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using Steamworks.ServerList;
namespace Barotrauma
{
@@ -111,7 +110,7 @@ namespace Barotrauma
public void OnSpawned(Entity spawnedItem)
{
if (!(spawnedItem is Item item)) { throw new ArgumentException($"The entity passed to ItemSpawnInfo.OnSpawned must be an Item (value was {spawnedItem?.ToString() ?? "null"})."); }
if (spawnedItem is not Item item) { throw new ArgumentException($"The entity passed to ItemSpawnInfo.OnSpawned must be an Item (value was {spawnedItem?.ToString() ?? "null"})."); }
onSpawned?.Invoke(item);
}
}
@@ -443,6 +442,7 @@ namespace Barotrauma
CreateNetworkEventProjSpecific(new SpawnEntity(spawnedEntity));
}
spawnInfo.OnSpawned(spawnedEntity);
GameMain.GameSession?.EventManager?.EntitySpawned(spawnedEntity);
}
}
}
@@ -195,7 +195,7 @@ namespace Barotrauma.Networking
int orderPriority = msg.ReadByte();
OrderTarget orderTargetPosition = null;
Order.OrderTargetType orderTargetType = (Order.OrderTargetType)msg.ReadByte();
int wallSectionIndex = 0;
int? wallSectionIndex = null;
if (msg.ReadBoolean())
{
float x = msg.ReadSingle();
@@ -252,6 +252,13 @@ namespace Barotrauma.Networking
continue;
}
#if CLIENT
foreach (var itemComponent in item.Components)
{
itemComponent.StopLoopingSound();
}
#endif
//restore other items to full condition and recharge batteries
item.Condition = item.MaxCondition;
item.GetComponent<Repairable>()?.ResetDeterioration();
@@ -848,6 +848,13 @@ namespace Barotrauma.Networking
private set;
}
[Serialize(10.0f, IsPropertySaveable.Yes)]
public float MinimumMidRoundSyncTimeout
{
get;
private set;
}
private bool karmaEnabled;
[Serialize(false, IsPropertySaveable.Yes)]
public bool KarmaEnabled