More AI fixes/improvements:

- AI characters can refuel the reactor when needed.
- AIObjectiveContainItem.CanBeCompleted returns true if the target item cannot be obtained or if the container cannot be reached.
- AI characters only weld leaks that are part of some submarine (i.e. not ruins).
This commit is contained in:
Joonas Rikkonen
2017-12-28 19:44:48 +02:00
parent d074d3d443
commit b84c965be3
7 changed files with 142 additions and 46 deletions
@@ -399,7 +399,7 @@ namespace Barotrauma.Items.Components
float[] skillSuccess = new float[requiredSkills.Count];
for (int i = 0; i < requiredSkills.Count; i++ )
for (int i = 0; i < requiredSkills.Count; i++)
{
int characterLevel = character.GetSkillLevel(requiredSkills[i].Name);
@@ -408,7 +408,7 @@ namespace Barotrauma.Items.Components
float average = skillSuccess.Average();
return (average+100.0f)/2.0f;
return (average + 100.0f) / 2.0f;
}
public virtual void FlipX() { }