Bunch of crew AI bugfixes/improvements:

- replacing empty oxygen tanks
- fixed characters only fixing leaks in the outer hull
- prioritizing large leaks over small ones
- fixed characters doing nothing after fixing all the leaks (and sinking to the bottom if they happen to be outside)
- more accurate welder aiming
- AIObjectiveGetItem makes the characters go to the cabinet/container an item is inside, not to the actual item (which may not be actually positioned at the container)
This commit is contained in:
Regalis
2016-03-16 17:41:59 +02:00
parent 804510b144
commit d6a57f9533
15 changed files with 228 additions and 163 deletions
+2
View File
@@ -38,6 +38,8 @@ namespace Barotrauma
public Door ConnectedDoor;
public Structure ConnectedWall;
public Vector2 LerpedFlowForce
{
get { return lerpedFlowForce; }
+4 -2
View File
@@ -577,8 +577,9 @@ namespace Barotrauma
gapRect.Width += 20;
gapRect.Height += 20;
sections[sectionIndex].gap = new Gap(gapRect, !isHorizontal, Submarine);
if(CastShadow)
GenerateConvexHull();
sections[sectionIndex].gap.ConnectedWall = this;
if(CastShadow) GenerateConvexHull();
}
}
@@ -758,6 +759,7 @@ namespace Barotrauma
if (s.GapIndex == -1) continue;
s.gap = FindEntityByID((ushort)s.GapIndex) as Gap;
if (s.gap != null) s.gap.ConnectedWall = this;
}
}
+3 -3
View File
@@ -299,7 +299,7 @@ namespace Barotrauma
wayPoint.Remove();
}
float minDist = 200.0f;
float minDist = 150.0f;
float heightFromFloor = 100.0f;
foreach (Hull hull in Hull.hullList)
@@ -324,7 +324,7 @@ namespace Barotrauma
prevWaypoint = wayPoint;
}
}
float outSideWaypointInterval = 200.0f;
int outsideWaypointDist = 100;
@@ -521,7 +521,7 @@ namespace Barotrauma
for (int dir = -1; dir <= 1; dir += 2)
{
float tolerance = gap.IsRoomToRoom ? 30.0f : outSideWaypointInterval / 2.0f;
float tolerance = gap.IsRoomToRoom ? 50.0f : outSideWaypointInterval / 2.0f;
WayPoint closest = wayPoint.FindClosest(dir, true, new Vector2(-tolerance, tolerance));
if (closest == null) continue;
wayPoint.ConnectTo(closest);