Merge branch 'dev' of https://github.com/Regalis11/Barotrauma.git into unstable-tests
This commit is contained in:
@@ -397,11 +397,6 @@ namespace Barotrauma.Items.Components
|
||||
//Only add valid connections
|
||||
if (otherC.Grid != grid && (otherC.Grid == null || !Grids.ContainsKey(otherC.Grid.ID)) && ValidPowerConnection(c, otherC))
|
||||
{
|
||||
if (otherC.Item.Condition <= 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
otherC.Grid = grid; //Assigning ID early prevents unncessary adding to stack
|
||||
probeStack.Push(otherC);
|
||||
}
|
||||
@@ -665,7 +660,10 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public static bool ValidPowerConnection(Connection conn1, Connection conn2)
|
||||
{
|
||||
return conn1.IsPower && conn2.IsPower && (conn1.Item.HasTag("junctionbox") || conn2.Item.HasTag("junctionbox") || conn1.Item.HasTag("dock") || conn2.Item.HasTag("dock") || conn1.IsOutput != conn2.IsOutput);
|
||||
return
|
||||
conn1.IsPower && conn2.IsPower &&
|
||||
conn1.Item.Condition > 0.0f && conn2.Item.Condition > 0.0f &&
|
||||
(conn1.Item.HasTag("junctionbox") || conn2.Item.HasTag("junctionbox") || conn1.Item.HasTag("dock") || conn2.Item.HasTag("dock") || conn1.IsOutput != conn2.IsOutput);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
if (Voltage > OverloadVoltage && CanBeOverloaded)
|
||||
if (Voltage > OverloadVoltage && CanBeOverloaded && item.Repairables.Any())
|
||||
{
|
||||
item.Condition = 0.0f;
|
||||
}
|
||||
|
||||
@@ -957,7 +957,18 @@ namespace Barotrauma
|
||||
|
||||
public PriceInfo GetPriceInfo(Location.StoreInfo store)
|
||||
{
|
||||
if (!store.Identifier.IsEmpty && StorePrices != null && StorePrices.TryGetValue(store.Identifier, out var storePriceInfo))
|
||||
if (store == null)
|
||||
{
|
||||
string message = $"Tried to get price info for \"{Identifier}\" with a null store parameter!\n{Environment.StackTrace.CleanupStackTrace()}";
|
||||
#if DEBUG
|
||||
DebugConsole.ShowError(message);
|
||||
#else
|
||||
DebugConsole.AddWarning(message);
|
||||
GameAnalyticsManager.AddErrorEventOnce("ItemPrefab.GetPriceInfo:StoreParameterNull", GameAnalyticsManager.ErrorSeverity.Error, message);
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
else if (!store.Identifier.IsEmpty && StorePrices != null && StorePrices.TryGetValue(store.Identifier, out var storePriceInfo))
|
||||
{
|
||||
return storePriceInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user