Merge branch 'CBT' into dev_itemrefactor

This commit is contained in:
NotAlwaysTrue
2026-04-30 22:15:38 +08:00
427 changed files with 24386 additions and 11539 deletions
@@ -234,6 +234,8 @@ namespace Barotrauma
public const float OxygenDeteriorationSpeed = 0.3f;
public const float OxygenConsumptionSpeed = 700.0f;
private const float DecalAlphaRemoveThreshold = 0.001f;
public const int WaveWidth = 32;
public static float WaveStiffness = 0.01f;
public static float WaveSpread = 0.02f;
@@ -997,22 +999,24 @@ namespace Barotrauma
Oxygen -= OxygenDeteriorationSpeed * deltaTime;
if (FakeFireSources.Count > 0)
SingleThreadWorker.Instance.AddAction(() =>
{
if ((Character.Controlled?.CharacterHealth?.GetAffliction("psychosis")?.Strength ?? 0.0f) <= 0.0f)
if (FakeFireSources.Count > 0)
{
for (int i = FakeFireSources.Count - 1; i >= 0; i--)
if ((Character.Controlled?.CharacterHealth?.GetAffliction("psychosis")?.Strength ?? 0.0f) <= 0.0f)
{
if (FakeFireSources[i].CausedByPsychosis)
for (int i = FakeFireSources.Count - 1; i >= 0; i--)
{
FakeFireSources[i].Remove();
if (FakeFireSources[i].CausedByPsychosis)
{
FakeFireSources[i].Remove();
}
}
}
FireSource.UpdateAll(FakeFireSources, deltaTime);
}
FireSource.UpdateAll(FakeFireSources, deltaTime);
}
FireSource.UpdateAll(FireSources, deltaTime);
FireSource.UpdateAll(FireSources, deltaTime);
});
foreach (Decal decal in decals)
{
@@ -1024,7 +1028,7 @@ namespace Barotrauma
for (int i = decals.Count - 1; i >= 0; i--)
{
var decal = decals[i];
if (decal.FadeTimer >= decal.LifeTime || decal.BaseAlpha <= 0.001f)
if (decal.FadeTimer >= decal.LifeTime || decal.BaseAlpha <= DecalAlphaRemoveThreshold)
{
decals.RemoveAt(i);
#if SERVER
@@ -1282,7 +1286,10 @@ namespace Barotrauma
Hull currentHull = current.hull;
Vector2 currentPos = current.pos;
if (currentDist > maxDistance) { return float.MaxValue; }
if (currentDist > maxDistance)
{
return float.MaxValue;
}
// If we've reached the target, add the final segment from hull to endPos
if (currentHull == targetHull)
@@ -1290,7 +1297,7 @@ namespace Barotrauma
return currentDist + Vector2.Distance(currentPos, endPos);
}
foreach (Gap g in ConnectedGaps)
foreach (Gap g in currentHull.ConnectedGaps)
{
float distanceMultiplier = 1;
if (g.ConnectedDoor != null && !g.ConnectedDoor.IsBroken)
@@ -1766,9 +1773,18 @@ namespace Barotrauma
bool decalsCleaned = false;
foreach (Decal decal in decals)
{
// Don't attempt to clean the decal if it's already below the remove threshold, since the server
// is already gonna remove the decal for us, sending another decal update event would result in
// us potentially modifying a different decal since the indices can briefly desync.
if (decal.BaseAlpha <= DecalAlphaRemoveThreshold)
{
continue;
}
if (decal.AffectsSection(section))
{
decal.Clean(cleanVal);
decalsCleaned = true;
#if SERVER
decalUpdatePending = true;