- AI equips a diving suit before going out

- placing a firesource outside any hull won't crash the game
- scrollbars aren't gray
- fixed client crashing if in the lobby when a round ends
- fixed password box crashing
This commit is contained in:
Regalis
2016-01-25 18:47:19 +02:00
parent 89405d786b
commit 08daab9d87
12 changed files with 177 additions and 48 deletions
@@ -10,11 +10,11 @@ namespace Barotrauma
{
class AIObjectiveGoTo : AIObjective
{
Entity target;
private Entity target;
Vector2 targetPos;
private Vector2 targetPos;
bool repeat;
private bool repeat;
//how long until the path to the target is declared unreachable
private float waitUntilPathUnreachable;
@@ -90,7 +90,7 @@ namespace Barotrauma
{
//currTargetPos += target.Submarine.SimPosition;
}
else if (target.Submarine==null)
else if (target.Submarine == null)
{
currTargetPos -= Submarine.Loaded.SimPosition;
}
@@ -103,9 +103,15 @@ namespace Barotrauma
}
else
{
character.AIController.SteeringManager.SteeringSeek(currTargetPos);
character.AIController.SteeringManager.SteeringSeek(currTargetPos);
var indoorsSteering = character.AIController.SteeringManager as IndoorsSteeringManager;
if (indoorsSteering.CurrentPath != null && indoorsSteering.HasOutdoorsNodes)
{
AddSubObjective(new AIObjectiveGetItem(character, "Diving Suit", true));
}
}
}