(22ec3a281) Add a boolean that controls whether or not the enemy attacks outposts and the characters inside it.

This commit is contained in:
Joonas Rikkonen
2019-04-16 17:12:43 +03:00
parent 707d9ed398
commit 0c42ad1572
3 changed files with 96 additions and 29 deletions
@@ -14,6 +14,11 @@ namespace Barotrauma
{
public static bool DisableEnemyAI;
/// <summary>
/// Enable the character to attack the outposts and the characters inside them. Disabled by default.
/// </summary>
public bool TargetOutposts;
class WallTarget
{
public Vector2 Position;
@@ -1067,11 +1072,11 @@ namespace Barotrauma
continue;
}
if (target.Type == AITarget.TargetType.HumanOnly) { continue; }
// Don't attack outposts.
if (target.Entity.Submarine != null && target.Entity.Submarine.IsOutpost) { continue; }
if (!TargetOutposts)
{
if (target.Entity.Submarine != null && target.Entity.Submarine.IsOutpost) { continue; }
}
Character targetCharacter = target.Entity as Character;
//ignore the aitarget if it is the Character itself
if (targetCharacter == character) continue;