(724e27ce7) Made damaged junction boxes less sensitive to overvoltage. Nearly broken junction boxes were barely able to handle any overvoltage, leading to chain reaction where one junction box breaking causes the grid to be overloaded, and the rest of the boxes start taking damage at an increasing speed. Related to #1361
This commit is contained in:
@@ -180,7 +180,8 @@ namespace Barotrauma.Items.Components
|
||||
#endif
|
||||
|
||||
//items in a bad condition are more sensitive to overvoltage
|
||||
float maxOverVoltage = MathHelper.Lerp(Math.Min(OverloadVoltage, 1.0f), OverloadVoltage, item.Condition / item.MaxCondition);
|
||||
float maxOverVoltage = MathHelper.Lerp(OverloadVoltage * 0.75f, OverloadVoltage, item.Condition / item.MaxCondition);
|
||||
maxOverVoltage = Math.Max(OverloadVoltage, 1.0f);
|
||||
|
||||
//if the item can't be fixed, don't allow it to break
|
||||
if (!item.Repairables.Any() || !CanBeOverloaded) continue;
|
||||
|
||||
Reference in New Issue
Block a user