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:
@@ -16,16 +16,16 @@ namespace Barotrauma.Items.Components
|
||||
class Controller : ItemComponent
|
||||
{
|
||||
//where the limbs of the user should be positioned when using the controller
|
||||
List<LimbPos> limbPositions;
|
||||
private List<LimbPos> limbPositions;
|
||||
|
||||
Direction dir;
|
||||
private Direction dir;
|
||||
|
||||
//the x-position where the user walks to when using the controller
|
||||
float userPos;
|
||||
private float userPos;
|
||||
|
||||
Camera cam;
|
||||
private Camera cam;
|
||||
|
||||
Character character;
|
||||
private Character character;
|
||||
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
public float UserPos
|
||||
|
||||
@@ -192,6 +192,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
foreach (Connection connection in connections)
|
||||
{
|
||||
if (!connection.IsPower) continue;
|
||||
foreach (Connection recipient in connection.Recipients)
|
||||
{
|
||||
Item it = recipient.Item as Item;
|
||||
@@ -311,7 +312,7 @@ namespace Barotrauma.Items.Components
|
||||
new Vector2(10, 40 * (temperature / 10000.0f)), new Color(temperature / 10000.0f, 1.0f - (temperature / 10000.0f), 0.0f, 1.0f), true);
|
||||
}
|
||||
|
||||
public override bool AIOperate(float deltaTime, Character character, AIObjective objective)
|
||||
public override bool AIOperate(float deltaTime, Character character, AIObjectiveOperateItem objective)
|
||||
{
|
||||
switch (objective.Option.ToLower())
|
||||
{
|
||||
|
||||
@@ -166,25 +166,25 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
Vector2 diff = ConvertUnits.ToSimUnits(steeringPath.NextNode.Position - item.WorldPosition);
|
||||
|
||||
//bool nextVisible = true;
|
||||
//for (int x = -1; x < 2; x += 2)
|
||||
//{
|
||||
// for (int y = -1; y < 2; y += 2)
|
||||
// {
|
||||
// Vector2 cornerPos =
|
||||
// new Vector2(Submarine.Borders.Width * x, Submarine.Borders.Height * y) / 2.0f;
|
||||
bool nextVisible = true;
|
||||
for (int x = -1; x < 2; x += 2)
|
||||
{
|
||||
for (int y = -1; y < 2; y += 2)
|
||||
{
|
||||
Vector2 cornerPos =
|
||||
new Vector2(Submarine.Borders.Width * x, Submarine.Borders.Height * y) / 2.0f;
|
||||
|
||||
// cornerPos = ConvertUnits.ToSimUnits(cornerPos*1.2f);
|
||||
cornerPos = ConvertUnits.ToSimUnits(cornerPos * 1.2f + Submarine.Loaded.Position);
|
||||
|
||||
// if (Submarine.PickBody(cornerPos, cornerPos + diff, null, Physics.CollisionLevel) == null) continue;
|
||||
|
||||
// nextVisible = false;
|
||||
// x = 2;
|
||||
// y = 2;
|
||||
// }
|
||||
//}
|
||||
if (Submarine.PickBody(cornerPos, cornerPos + diff, null, Physics.CollisionLevel) == null) continue;
|
||||
|
||||
//if (nextVisible) steeringPath.SkipToNextNode();
|
||||
nextVisible = false;
|
||||
x = 2;
|
||||
y = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextVisible) steeringPath.SkipToNextNode();
|
||||
|
||||
autopilotRayCastTimer = AutopilotRayCastInterval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user