Autopilot waypoint skipping, AI finds and equips diving gear when the sub is flooding, progress on AI welding, equipping items in AIObjectiveGetItem, wire node coordinate bugfixes, EntityGrid.RemoveEntity fix

This commit is contained in:
Regalis11
2015-12-23 00:10:02 +02:00
parent 63f5a501e8
commit c7e7b3909f
35 changed files with 402 additions and 257 deletions
@@ -29,9 +29,7 @@ namespace Barotrauma.Items.Components
private List<StatusEffect> effects;
public readonly ushort[] wireId;
private List<Connection> recipients;
public bool IsPower
{
get;
@@ -40,7 +38,17 @@ namespace Barotrauma.Items.Components
public List<Connection> Recipients
{
get { return recipients; }
get
{
List<Connection> recipients = new List<Connection>();
for (int i = 0; i < MaxLinked; i++)
{
if (Wires[i] == null) continue;
Connection recipient = Wires[i].OtherConnection(this);
if (recipient != null) recipients.Add(recipient);
}
return recipients;
}
}
public Item Item
@@ -63,9 +71,7 @@ namespace Barotrauma.Items.Components
//recipient = new Connection[MaxLinked];
Wires = new Wire[MaxLinked];
recipients = new List<Connection>();
IsOutput = (element.Name.ToString() == "output");
Name = ToolBox.GetAttributeString(element, "name", (IsOutput) ? "output" : "input");
@@ -139,13 +145,7 @@ namespace Barotrauma.Items.Components
public void UpdateRecipients()
{
recipients.Clear();
for (int i = 0; i < MaxLinked; i++)
{
if (Wires[i] == null) continue;
Connection recipient = Wires[i].OtherConnection(this);
if (recipient != null) recipients.Add(recipient);
}
}
public void SendSignal(string signal, Item sender, float power)
@@ -180,9 +180,7 @@ namespace Barotrauma.Items.Components
Wires[i].RemoveConnection(this);
Wires[i] = null;
}
recipients.Clear();
}
}