Build 0.17.14.0
This commit is contained in:
@@ -584,19 +584,16 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
availableCharge = 0.0f;
|
||||
availableCapacity = 0.0f;
|
||||
if (item.Connections == null) { return; }
|
||||
foreach (Connection c in item.Connections)
|
||||
if (item.Connections == null || powerIn == null) { return; }
|
||||
var recipients = powerIn.Recipients;
|
||||
foreach (Connection recipient in recipients)
|
||||
{
|
||||
var recipients = c.Recipients;
|
||||
foreach (Connection recipient in recipients)
|
||||
{
|
||||
if (!recipient.IsPower || !recipient.IsOutput) { continue; }
|
||||
var battery = recipient.Item?.GetComponent<PowerContainer>();
|
||||
if (battery == null) { continue; }
|
||||
availableCharge += battery.Charge;
|
||||
availableCapacity += battery.Capacity;
|
||||
}
|
||||
}
|
||||
if (!recipient.IsPower || !recipient.IsOutput) { continue; }
|
||||
var battery = recipient.Item?.GetComponent<PowerContainer>();
|
||||
if (battery == null || battery.Item.Condition <= 0.0f) { continue; }
|
||||
availableCharge += battery.Charge;
|
||||
availableCapacity += battery.Capacity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -273,10 +273,16 @@ namespace Barotrauma
|
||||
foreach (string tag in readTags)
|
||||
{
|
||||
string[] s = tag.Split(':');
|
||||
if (s[0] == "name")
|
||||
idName = s[1];
|
||||
if (s[0] == "job")
|
||||
idJob = s[1];
|
||||
switch (s[0])
|
||||
{
|
||||
case "name":
|
||||
idName = s[1];
|
||||
break;
|
||||
case "job":
|
||||
case "jobid":
|
||||
idJob = s[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idName != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user